~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Wrappers/DoxygenWrapper/Data/Sharp_Templates/MultiDelegateEvent3.txt

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
               #region Event #{DelegateName}
 
2
 
 
3
                [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
 
4
                private static extern void Export#{ThisName}Event_Advise#{DelegateName}(IntPtr _native, bool _advise);
 
5
 
 
6
                public delegate void Handle#{DelegateName}(
 
7
                        #{ValueTypePrefix1}#{TypeName1} #{ValueName1},
 
8
                        #{ValueTypePrefix2}#{TypeName2} #{ValueName2},
 
9
                        #{ValueTypePrefix3}#{TypeName3} #{ValueName3});
 
10
                        
 
11
                private Handle#{DelegateName} mEvent#{DelegateName};
 
12
                public event Handle#{DelegateName} Event#{DelegateName}
 
13
                {
 
14
                        add
 
15
                        {
 
16
                                if (ExportEvent#{DelegateName}.mDelegate == null)
 
17
                                {
 
18
                                        ExportEvent#{DelegateName}.mDelegate = new ExportEvent#{DelegateName}.ExportHandle(OnExport#{DelegateName});
 
19
                                        ExportEvent#{DelegateName}.Export#{ThisName}Event_Delegate#{DelegateName}(ExportEvent#{DelegateName}.mDelegate);
 
20
                                }
 
21
 
 
22
                                if (mEvent#{DelegateName} == null)
 
23
                                        Export#{ThisName}Event_Advise#{DelegateName}(Native, true);
 
24
                                mEvent#{DelegateName} += value;
 
25
                        }
 
26
                        remove
 
27
                        {
 
28
                                mEvent#{DelegateName} -= value;
 
29
                                if (mEvent#{DelegateName} == null)
 
30
                                        Export#{ThisName}Event_Advise#{DelegateName}(Native, false);
 
31
                        }
 
32
                }
 
33
 
 
34
                private struct ExportEvent#{DelegateName}
 
35
                {
 
36
                        [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
 
37
                        public static extern void Export#{ThisName}Event_Delegate#{DelegateName}(ExportHandle _delegate);
 
38
                        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
 
39
                        public delegate void ExportHandle(
 
40
                                #{ValueMarshalAs1}#{ValueTypePrefix1}#{ValueTypeName1} #{ValueName1},
 
41
                                #{ValueMarshalAs2}#{ValueTypePrefix2}#{ValueTypeName2} #{ValueName2},
 
42
                                #{ValueMarshalAs3}#{ValueTypePrefix3}#{ValueTypeName3} #{ValueName3});
 
43
                                
 
44
                        public static ExportHandle mDelegate;
 
45
                }
 
46
 
 
47
                private static void OnExport#{DelegateName}(
 
48
                        #{ValueTypePrefix1}#{ValueTypeName1} #{ValueName1},
 
49
                        #{ValueTypePrefix2}#{ValueTypeName2} #{ValueName2},
 
50
                        #{ValueTypePrefix3}#{ValueTypeName3} #{ValueName3})
 
51
                {
 
52
                        #{ValueTypePrefix1}#{TypeName1} sender = (#{ValueTypePrefix1}#{TypeName1})BaseWidget.GetByNative(#{ValueName1});
 
53
 
 
54
                        if (sender.mEvent#{DelegateName} != null)
 
55
                                sender.mEvent#{DelegateName}(
 
56
                                        sender ,
 
57
                                        #{ValueConvertBefore2}#{ValueTypePrefix2}#{ValueName2}#{ValueConvertPost2},
 
58
                                        #{ValueConvertBefore3}#{ValueTypePrefix3}#{ValueName3}#{ValueConvertPost3});
 
59
                }
 
60
 
 
61
                #endregion