Наследование: System.Runtime.InteropServices.SafeHandle
Пример #1
0
 public EvUserEvent(EventBase evBase)
 {
     if (Platform.RunningOnWindows)
     {
         var winCb = new Event.D.event_callback_windows(CallbackWin);
         _winCbHandle = GCHandle.Alloc(winCb);
         _event       = Event.EventNewWindows(evBase, new IntPtr(-1), 0, winCb, IntPtr.Zero);
     }
     else
     {
         var nixCb = new Event.D.event_callback_normal(CallbackNix);
         _nixCbHandle = GCHandle.Alloc(nixCb);
         _event       = Event.EventNewNix(evBase, -1, 0, nixCb, IntPtr.Zero);
     }
 }
Пример #2
0
 public EvUserEvent(EventBase evBase)
 {
     if (Platform.RunningOnWindows)
     {
         var winCb = new Event.D.event_callback_windows(CallbackWin);
         _winCbHandle = GCHandle.Alloc(winCb);
         _event = Event.EventNewWindows(evBase, new IntPtr(-1), 0, winCb, IntPtr.Zero);
     }
     else
     {
         var nixCb = new Event.D.event_callback_normal(CallbackNix);
         _nixCbHandle = GCHandle.Alloc(nixCb);
         _event = Event.EventNewNix(evBase, -1, 0, nixCb, IntPtr.Zero);
     }
 }