public void NextFile() { if ((currentFileList.Count > currentFileIndex) && (currentFileList[currentFileIndex] == currentFile)) { currentFileIndex++; if (currentFileIndex < currentFileList.Count) { currentFile = currentFileList[currentFileIndex]; } } else { Reset(currentSearchType); } }
public void Reset(SearchType currentSearchType) { this.currentSearchType = currentSearchType; LoadTextForSearch(); currentFileList = FileEnumerator(currentSearchType).ToList(); currentFileIndex = 0; if (currentFileList.Count != 0) { currentFile = currentFileList[0]; if (currentFile != null) { searcher.Text = currentFile.Text; } searcher.StartOffset = 0; } }
private void LoadTextForSearch() { if ((core.Solution != null)) { solutionFiles.Clear(); foreach (Schematix.ProjectExplorer.Project proj in core.Solution.ProjectList) { foreach (Schematix.ProjectExplorer.VHDL_Code_File vhdlFile in proj.GetProjectElements <Schematix.ProjectExplorer.VHDL_Code_File>()) { string text = GetTextFromProjElement(vhdlFile); solutionFiles.Add(new SearchSource(text, vhdlFile.Path)); } } } if ((core.Solution != null) && (core.Solution.CurrentSelectedProject != null)) { curProjFiles.Clear(); foreach (Schematix.ProjectExplorer.VHDL_Code_File vhdlFile in core.Solution.CurrentSelectedProject.GetProjectElements <Schematix.ProjectExplorer.VHDL_Code_File>()) { string text = GetTextFromProjElement(vhdlFile); curProjFiles.Add(new SearchSource(text, vhdlFile.Path)); } } if ((core.MainWindow.CurrentActiveWindow != null) && (core.MainWindow.CurrentActiveWindow is Schematix.Windows.Code.Code)) { string path = (core.MainWindow.CurrentActiveWindow as Schematix.Windows.Code.Code).ProjectElement.Path; string text = (core.MainWindow.CurrentActiveWindow as Schematix.Windows.Code.Code).EditorText; currentDocument = new SearchSource(text, path); } if (core.MainWindow.CurrentActiveWindow != null) { allOpenedDocuments.Clear(); foreach (Schematix.Windows.SchematixBaseWindow window in core.OpenedWindows().ToList()) { if ((window != null) && (window is Schematix.Windows.Code.Code)) { string path = (window as Schematix.Windows.Code.Code).ProjectElement.Path; string text = (window as Schematix.Windows.Code.Code).EditorText; SearchSource res = new SearchSource(text, path); allOpenedDocuments.Add(res); } } } }
public SearchResult(SearchSource code, ICSharpCode.AvalonEdit.Document.TextSegment segment) { this.code = code; this.segment = segment; }