public void Close(Action callback) { if (NativeHandle == IntPtr.Zero) { return; } CAction ca = new CAction(() => { // Remove handle Loop.handles.Remove(NativeHandle); if (Closed != null) { Closed(); } if (callback != null) { callback(); } Dispose(); }); uv_close(NativeHandle, ca.Callback); }
public void Close(Action callback) { if (handle == IntPtr.Zero) { return; } CAction ca = new CAction(() => { // Remove handle Loop.handles.Remove(handle); if (CloseEvent != null) { CloseEvent(); } if (callback != null) { callback(); } Dispose(); }); int r = uv_close(handle, ca.Callback); Ensure.Success(r, Loop); }
public void QueueWork(Action callback, Action after) { var pr = new PermaRequest(UV.Sizeof(UvRequestType.UV_WORK)); var before = new CAction <IntPtr>((ptr) => callback()); var cafter = new CAction <IntPtr>((ptr) => { pr.Dispose(); if (after != null) { after(); } }); int r = uv_queue_work(Handle, pr.Handle, before.Callback, cafter.Callback); Ensure.Success(r, this); }
public void Once(Action callback) { var cb = new CAction(callback); uv_once(Handle, cb.Callback); }
public void Walk(Action <IntPtr> callback) { var cb = new CAction <IntPtr, IntPtr>((handle, arg) => callback(handle)); uv_walk(Handle, cb.Callback, IntPtr.Zero); }
public void Walk(Action<IntPtr> callback) { var cb = new CAction<IntPtr, IntPtr>((handle, arg) => callback(handle)); uv_walk(Handle, cb.Callback, IntPtr.Zero); }
public void QueueWork(Action callback, Action after) { var pr = new PermaRequest(UV.Sizeof(UvRequestType.UV_WORK)); var before = new CAction<IntPtr>((ptr) => callback()); var cafter = new CAction<IntPtr>((ptr) => { pr.Dispose(); if (after != null) { after(); } }); int r = uv_queue_work(Handle, pr.Handle, before.Callback, cafter.Callback); Ensure.Success(r, this); }