public BackgroundSearcher(DocumentHierarchySearcher documentHierarchySearcher) { this.DocumentHierarchySearcher = documentHierarchySearcher; this.StartTimestamp = DateTime.Now; this.DoWork += RunSearching; this.WorkerSupportsCancellation = true; }
public MainViewModel() { this.searchInFiles = ConfigHandler.ReadConfigBoolValue("SearchInFiles", true); this.showAllFiles = ConfigHandler.ReadConfigBoolValue("ShowAllFiles", true); this.FilesPatternProvider = new FilesPatternProvider(this.showAllFiles); this.syncWithActiveDocument = ConfigHandler.ReadConfigBoolValue("SyncWithActiveDocument", false); var searchField = (this.searchInFiles ? FullTextFieldType.CatchAll : FullTextFieldType.Name); this.SearchOptions = new SearchOptions(searchField, string.Empty); this.DocumentHierarchyFactory = new DocumentHierarchyFactory(); this.FileSystemChangeWatcher = new FileSystemChangeWatcher(this.ReindexOnFileSystemChanged); this.IndexingSearchingModel = new IndexingSearchingModel(this.OnSearchingFinished, this.OnIndexingFinished, this.OnIndexingProgress); this.TreeViewModel = new TreeViewModel(this.FileSystemChangeWatcher, this.DocumentHierarchyFactory, this.FilesPatternProvider); this.TreeViewModel.PropertyChanged += (s, e) => { if (e.PropertyName == "NumberOfFiles") { this.OnPropertyChanged("TreeItemsResultString"); } }; this.WorkspaceDirectoryModel = new WorkspaceDirectoryModel(); if (this.WorkspaceDirectoryModel.CurrentWorkspaceDirectory != null) { this.DocumentHierarchySearcher = this.DocumentHierarchyFactory.CreateDocumentHierarchySearcher(this.WorkspaceDirectoryModel.CurrentWorkspaceDirectory); } this.WorkspaceDirectoryModel.PropertyChanged += this.OnWorkspaceDirectoryChanged; }
public GoToDefinitionCommand(IseIntegrator iseIntegrator, PowershellTokenizerProvider powershellTokenizerProvider, DocumentHierarchyFactory documentHierarchyFactory, DocumentHierarchySearcher documentHierarchySearcher) { this.iseIntegrator = iseIntegrator; this.powershellTokenizerProvider = powershellTokenizerProvider; this.documentHierarchyFactory = documentHierarchyFactory; this.documentHierarchySearcher = documentHierarchySearcher; }
private void OnWorkspaceDirectoryChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "CurrentWorkspaceDirectory") { this.DocumentHierarchySearcher = this.DocumentHierarchyFactory.CreateDocumentHierarchySearcher(this.WorkspaceDirectoryModel.CurrentWorkspaceDirectory); this.ReindexSearchTree(); } }
public RunSearchCommand(DocumentHierarchySearcher documentHierarchySearcher, MainViewModel mainViewModel, TreeViewModel treeViewModel, DocumentHierarchyFactory documentHierarchyFactory, ClearTreeViewCommand clearTreeViewCommand, SyncWithActiveDocumentCommand syncWithActiveDocumentCommand) { this.documentHierarchySearcher = documentHierarchySearcher; this.mainViewModel = mainViewModel; this.treeViewModel = treeViewModel; this.documentHierarchyFactory = documentHierarchyFactory; this.clearTreeViewCommand = clearTreeViewCommand; this.syncWithActiveDocumentCommand = syncWithActiveDocumentCommand; this.backgroundSearchers = new List <BackgroundSearcher>(); }
public BackgroundSearcherParams(DocumentHierarchySearcher documentHierarchySearcher, SearchOptions searchOptions, string path) { this.DocumentHierarchySearcher = documentHierarchySearcher; this.SearchOptions = new SearchOptions(searchOptions); this.Path = path; }