private static void StaticCallback(IntPtr loop, IntPtr watcher, EventTypes revents) { UnmanagedPrepareWatcher iow = (UnmanagedPrepareWatcher)Marshal.PtrToStructure(watcher, typeof(UnmanagedPrepareWatcher)); GCHandle gchandle = GCHandle.FromIntPtr(iow.data); PrepareWatcher w = (PrepareWatcher)gchandle.Target; w.callback(w.Loop, w, revents); }
public PrepareWatcher(Loop loop, PrepareWatcherCallback callback) : base(loop) { this.callback = callback; unmanaged_watcher = new UnmanagedPrepareWatcher(); unmanaged_watcher.callback = unmanaged_callback_ptr; InitializeUnmanagedWatcher(unmanaged_watcher); }
public PrepareWatcher(Loop loop, PrepareWatcherCallback callback) : base(loop) { this.callback = callback; unmanaged_watcher = new UnmanagedPrepareWatcher (); unmanaged_watcher.callback = unmanaged_callback_ptr; InitializeUnmanagedWatcher (unmanaged_watcher); }