Пример #1
0
        public void Handle(string path)
        {
            if (_watchers.TryRemove(path))
            {
                _eventReactor.React(EngineEvent.PathWatchingEnded, path);
            }

            _indexEjector.Eject(path);
        }
Пример #2
0
        public void Remove(string path)
        {
            if (!_watchers.TryRemove(path))
            {
                return;
            }

            _eventReactor.React(EngineEvent.PathWatchingEnded, path);
            _indexEjector.Eject(path);
        }
        public bool Remove(string path)
        {
            var fullPath = FileSystem.GetFullPath(path);

            if (string.IsNullOrWhiteSpace(fullPath))
            {
                return(false);
            }
            if (!FileSystem.IsExistingPath(fullPath))
            {
                return(false);
            }
            if (!_supervisor.IsUnderWatching(fullPath))
            {
                return(false);
            }

            _supervisor.Unwatch(fullPath);
            _indexEjector.Eject(fullPath);
            return(true);
        }