コード例 #1
0
        public SearchEngine(
            IFileSystemProcessor fileSystemProcessor,
            IFileSystemNameFactory fileSystemNameFactory,
            ITaskQueueFactory taskQueueFactory,
            IFileDatabaseFactory fileDatabaseFactory,
            IProjectDiscovery projectDiscovery,
            ICompiledTextSearchDataFactory compiledTextSearchDataFactory,
            IOperationProcessor operationProcessor)
        {
            _fileSystemNameFactory         = fileSystemNameFactory;
            _taskQueue                     = taskQueueFactory.CreateQueue("SearchEngine Task Queue");
            _fileDatabaseFactory           = fileDatabaseFactory;
            _projectDiscovery              = projectDiscovery;
            _compiledTextSearchDataFactory = compiledTextSearchDataFactory;
            _operationProcessor            = operationProcessor;

            // Create a "Null" state
            _currentFileDatabase = _fileDatabaseFactory.CreateEmpty();

            // Setup computing a new state everytime a new tree is computed.
            fileSystemProcessor.SnapshotComputed += FileSystemProcessorOnSnapshotComputed;
            fileSystemProcessor.FilesChanged     += FileSystemProcessorOnFilesChanged;
        }
コード例 #2
0
        public SearchEngine(
            IFileSystemProcessor fileSystemProcessor,
            IFileSystemNameFactory fileSystemNameFactory,
            ICustomThreadPool customThreadPool,
            IFileDatabaseFactory fileDatabaseFactory,
            IProjectDiscovery projectDiscovery,
            ISearchStringParser searchStringParser,
            IOperationProcessor <OperationResultEventArgs> fileLoadingOperationProcessor)
        {
            _fileSystemNameFactory         = fileSystemNameFactory;
            _customThreadPool              = customThreadPool;
            _fileDatabaseFactory           = fileDatabaseFactory;
            _projectDiscovery              = projectDiscovery;
            _searchStringParser            = searchStringParser;
            _fileLoadingOperationProcessor = fileLoadingOperationProcessor;

            // Create a "Null" state
            _currentFileDatabase = _fileDatabaseFactory.CreateEmpty();

            // Setup computing a new state everytime a new tree is computed.
            fileSystemProcessor.SnapshotComputed += FileSystemProcessorOnSnapshotComputed;
            fileSystemProcessor.FilesChanged     += FileSystemProcessorOnFilesChanged;
        }