Exemple #1
0
        internal static void FSEventStart(IntPtr handle, string path, FSEventMask mask)
        {
            Debug.Assert(handle != IntPtr.Zero);
            Debug.Assert(!string.IsNullOrEmpty(path));

            int result = uv_fs_event_start(handle, FSEvent.FSEventCallback, path, (int)mask);

            ThrowIfError(result);
        }
Exemple #2
0
        internal static void FSEventStart(IntPtr handle, string path, FSEventMask mask)
        {
            Contract.Requires(handle != IntPtr.Zero);
            Contract.Requires(!string.IsNullOrEmpty(path));

            int result = uv_fs_event_start(handle, FSEvent.FSEventCallback, path, (int)mask);

            if (result < 0)
            {
                throw CreateError((uv_err_code)result);
            }
        }
Exemple #3
0
        public FSEvent Start(string path,
                             Action <FSEvent, FileSystemEvent> callback,
                             FSEventMask mask = FSEventMask.None)
        {
            Contract.Requires(!string.IsNullOrEmpty(path));
            Contract.Requires(callback != null);

            this.Validate();
            this.eventCallback = callback;
            NativeMethods.FSEventStart(this.InternalHandle, path, mask);

            return(this);
        }
Exemple #4
0
        public FSEvent Start(string path,
                             Action <FSEvent, FileSystemEvent> callback,
                             FSEventMask mask = FSEventMask.None)
        {
            if (string.IsNullOrEmpty(path))
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.path);
            }
            if (callback is null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.callback);
            }

            Validate();
            _eventCallback = callback;
            NativeMethods.FSEventStart(InternalHandle, path, mask);

            return(this);
        }