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

« back to all changes in this revision

Viewing changes to Wrappers/DoxygenWrapper/Data/Sharp_Templates/DelegateEvent4.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
                        #{ValueTypePrefix4}#{TypeName4} #{ValueName4});
 
11
                        
 
12
                private Handle#{DelegateName} mEvent#{DelegateName};
 
13
                public event Handle#{DelegateName} Event#{DelegateName}
 
14
                {
 
15
                        add
 
16
                        {
 
17
                                if (ExportEvent#{DelegateName}.mDelegate == null)
 
18
                                {
 
19
                                        ExportEvent#{DelegateName}.mDelegate = new ExportEvent#{DelegateName}.ExportHandle(OnExport#{DelegateName});
 
20
                                        ExportEvent#{DelegateName}.Export#{ThisName}Event_Delegate#{DelegateName}(ExportEvent#{DelegateName}.mDelegate);
 
21
                                }
 
22
 
 
23
                                if (mEvent#{DelegateName} == null)
 
24
                                        Export#{ThisName}Event_Advise#{DelegateName}(Native, true);
 
25
                                mEvent#{DelegateName} += value;
 
26
                        }
 
27
                        remove
 
28
                        {
 
29
                                mEvent#{DelegateName} -= value;
 
30
                                if (mEvent#{DelegateName} == null)
 
31
                                        Export#{ThisName}Event_Advise#{DelegateName}(Native, false);
 
32
                        }
 
33
                }
 
34
 
 
35
                private struct ExportEvent#{DelegateName}
 
36
                {
 
37
                        [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
 
38
                        public static extern void Export#{ThisName}Event_Delegate#{DelegateName}(ExportHandle _delegate);
 
39
                        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
 
40
                        public delegate void ExportHandle(
 
41
                                #{ValueMarshalAs1}#{ValueTypePrefix1}#{ValueTypeName1} #{ValueName1},
 
42
                                #{ValueMarshalAs2}#{ValueTypePrefix2}#{ValueTypeName2} #{ValueName2},
 
43
                                #{ValueMarshalAs3}#{ValueTypePrefix3}#{ValueTypeName3} #{ValueName3},
 
44
                                #{ValueMarshalAs4}#{ValueTypePrefix4}#{ValueTypeName4} #{ValueName4});
 
45
                                
 
46
                        public static ExportHandle mDelegate;
 
47
                }
 
48
 
 
49
                private static void OnExport#{DelegateName}(
 
50
                        #{ValueTypePrefix1}#{ValueTypeName1} #{ValueName1},
 
51
                        #{ValueTypePrefix2}#{ValueTypeName2} #{ValueName2},
 
52
                        #{ValueTypePrefix3}#{ValueTypeName3} #{ValueName3},
 
53
                        #{ValueTypePrefix4}#{ValueTypeName4} #{ValueName4})
 
54
                {
 
55
                        #{ValueTypePrefix1}#{TypeName1} sender = (#{ValueTypePrefix1}#{TypeName1})BaseWidget.GetByNative(#{ValueName1});
 
56
 
 
57
                        if (sender.mEvent#{DelegateName} != null)
 
58
                                sender.mEvent#{DelegateName}(
 
59
                                        sender ,
 
60
                                        #{ValueConvertBefore2}#{ValueTypePrefix2}#{ValueName2}#{ValueConvertPost2},
 
61
                                        #{ValueConvertBefore3}#{ValueTypePrefix3}#{ValueName3}#{ValueConvertPost3},
 
62
                                        #{ValueConvertBefore4}#{ValueTypePrefix4}#{ValueName4}#{ValueConvertPost4});
 
63
                }
 
64
 
 
65
                #endregion