Пример #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
 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
        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);
        }