예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void Once(Action callback)
        {
            var cb = new CAction(callback);

            uv_once(Handle, cb.Callback);
        }
예제 #5
0
        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);
        }
예제 #6
0
 public void Once(Action callback)
 {
     var cb = new CAction(callback);
     uv_once(Handle, cb.Callback);
 }
예제 #7
0
        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);
        }
예제 #8
0
        public void Walk(Action <IntPtr> callback)
        {
            var cb = new CAction <IntPtr, IntPtr>((handle, arg) => callback(handle));

            uv_walk(Handle, cb.Callback, IntPtr.Zero);
        }
예제 #9
0
파일: Loop.cs 프로젝트: carlokok/LibuvSharp
 public void Walk(Action<IntPtr> callback)
 {
     var cb = new CAction<IntPtr, IntPtr>((handle, arg) => callback(handle));
     uv_walk(Handle, cb.Callback, IntPtr.Zero);
 }
예제 #10
0
파일: Loop.cs 프로젝트: carlokok/LibuvSharp
        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);
        }