예제 #1
0
        protected virtual void OnStatusUpdated()
        {
            _currentState = GetCurrentState();
            var e = new IndexingServerStateUpdatedEventArgs {
                State = _currentState
            };

            StateUpdated?.Invoke(this, e);
        }
예제 #2
0
        public IndexingServer(
            IDateTimeProvider dateTimeProvider,
            IFileSystemSnapshotManager fileSystemSnapshotManager,
            ITaskQueueFactory taskQueueFactory,
            ISearchEngine searchEngine)
        {
            _dateTimeProvider          = dateTimeProvider;
            _fileSystemSnapshotManager = fileSystemSnapshotManager;
            _stateChangeTaskQueue      = taskQueueFactory.CreateQueue("IndexingServer State Change Task Queue");

            _fileSystemSnapshotManager.SnapshotScanStarted    += FileSystemSnapshotManagerOnSnapshotScanStarted;
            _fileSystemSnapshotManager.SnapshotScanFinished   += FileSystemSnapshotManagerOnSnapshotScanFinished;
            _fileSystemSnapshotManager.FileSystemWatchPaused  += FileSystemSnapshotManagerOnFileSystemWatchPaused;
            _fileSystemSnapshotManager.FileSystemWatchResumed += FileSystemSnapshotManagerOnFileSystemWatchResumed;

            searchEngine.FilesLoading += SearchEngineOnFilesLoading;
            searchEngine.FilesLoaded  += SearchEngineOnFilesLoaded;
            _currentState              = GetCurrentState();
        }