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

            uv_once(Handle, cb.Callback);
        }
Beispiel #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);
        }
Beispiel #6
0
 public void Once(Action callback)
 {
     var cb = new CAction(callback);
     uv_once(Handle, cb.Callback);
 }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
 }
Beispiel #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);
        }