public SearchResult GetNextSearchResult() { if (isEndOfFileSequence() == true) { return(null); } else { ICSharpCode.AvalonEdit.Document.TextSegment segment = searcher.FindNext(); searcher.StartOffset += segment.Length; while (segment.Length == 0) { NextFile(); if (isEndOfFileSequence() == false) { string text = System.IO.File.ReadAllText(currentFile.Path); searcher.Text = text; searcher.StartOffset = 0; segment = searcher.FindNext(); if (segment.Length != 0) { return(new SearchResult(currentFile, segment)); } } else { return(null); } } return(new SearchResult(currentFile, segment)); } }
private ICSharpCode.AvalonEdit.Document.TextSegment Previous() { ICSharpCode.AvalonEdit.Document.TextSegment res = new ICSharpCode.AvalonEdit.Document.TextSegment(); Regex pattern = CreateRegularExpression(); foreach (Match m in pattern.Matches(Text)) { if ((m.Success) && (StartOffset >= (m.Index + m.Length))) { res.StartOffset = m.Index; res.Length = m.Length; } } return(res); }
public SearchResult(SearchSource code, ICSharpCode.AvalonEdit.Document.TextSegment segment) { this.code = code; this.segment = segment; }