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

« back to all changes in this revision

Viewing changes to Wrappers/DoxygenWrapper/Data/Sharp_Templates/DelegateRequest1.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 Request #{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
                        
 
9
                private Handle#{DelegateName} mEvent#{DelegateName};
 
10
                public event Handle#{DelegateName} Request#{DelegateName}
 
11
                {
 
12
                        add
 
13
                        {
 
14
                                if (ExportEvent#{DelegateName}.mDelegate == null)
 
15
                                {
 
16
                                        ExportEvent#{DelegateName}.mDelegate = new ExportEvent#{DelegateName}.ExportHandle(OnExport#{DelegateName});
 
17
                                        ExportEvent#{DelegateName}.Export#{ThisName}Event_Delegate#{DelegateName}(ExportEvent#{DelegateName}.mDelegate);
 
18
                                }
 
19
 
 
20
                                if (mEvent#{DelegateName} == null)
 
21
                                        Export#{ThisName}Event_Advise#{DelegateName}(Native, true);
 
22
                                mEvent#{DelegateName} += value;
 
23
                        }
 
24
                        remove
 
25
                        {
 
26
                                mEvent#{DelegateName} -= value;
 
27
                                if (mEvent#{DelegateName} == null)
 
28
                                        Export#{ThisName}Event_Advise#{DelegateName}(Native, false);
 
29
                        }
 
30
                }
 
31
 
 
32
                private struct ExportEvent#{DelegateName}
 
33
                {
 
34
                        [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
 
35
                        public static extern void Export#{ThisName}Event_Delegate#{DelegateName}(ExportHandle _delegate);
 
36
                        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
 
37
                        public delegate void ExportHandle(
 
38
                                #{ValueMarshalAs1}#{ValueTypePrefix1}#{ValueTypeName1} #{ValueName1});
 
39
                                
 
40
                        public static ExportHandle mDelegate;
 
41
                }
 
42
 
 
43
                private static void OnExport#{DelegateName}(
 
44
                        #{ValueTypePrefix1}#{ValueTypeName1} #{ValueName1})
 
45
                {
 
46
                        #{ValueTypePrefix1}#{TypeName1} sender = (#{ValueTypePrefix1}#{TypeName1})BaseWidget.GetByNative(#{ValueName1});
 
47
 
 
48
                        if (sender.mEvent#{DelegateName} != null)
 
49
                                sender.mEvent#{DelegateName}(
 
50
                                        sender);
 
51
                }
 
52
 
 
53
                #endregion