public bool Search(SearchSpec search) { makeChildrenVisible(); foreach (var word in search.require_all) { SearchInternal(word); } return(visible); }
public void Search(SearchSpec search) { Editor.Document.MarkerStrategy.RemoveAll(new Predicate <ICSharpCode.TextEditor.Document.TextMarker>(delegate { return(true); })); if (Editor.Document.TextLength != 0) { bool anyvisible = false; int firstmatch = int.MaxValue; string lower = Editor.Document.TextContent.ToLowerInvariant(); foreach (var word in search.require_all) { int pos = 0; var view = Editor.ActiveTextAreaControl.TextArea.TextView; int topRow = view.FirstVisibleLine; int bottomRow = topRow + view.VisibleLineCount; int leftColumn = Editor.ActiveTextAreaControl.HScrollBar.Value - Editor.ActiveTextAreaControl.HScrollBar.Minimum; int rightColumn = leftColumn + view.VisibleColumnCount; while ((pos = lower.IndexOf(word.as_lower, pos)) != -1) { Editor.Document.MarkerStrategy.AddMarker(new ICSharpCode.TextEditor.Document.TextMarker( pos, word.as_lower.Length, ICSharpCode.TextEditor.Document.TextMarkerType.SolidBlock, System.Drawing.Color.Red, System.Drawing.Color.White)); firstmatch = Math.Min(firstmatch, pos); if (!anyvisible) { int line = Editor.Document.GetLineNumberForOffset(pos); int col = pos - Editor.Document.GetLineSegmentForOffset(pos).Offset; anyvisible = (line >= topRow && line < bottomRow && col >= leftColumn && col < rightColumn); } pos += word.as_lower.Length; } } if (!anyvisible && firstmatch != int.MaxValue) { int line = Editor.Document.GetLineNumberForOffset(firstmatch); int col = firstmatch - Editor.Document.GetLineSegmentForOffset(firstmatch).Offset; Editor.ActiveTextAreaControl.ScrollTo(line, col); } } Editor.Refresh(); }
public void Search(SearchSpec search) { Editor.Document.MarkerStrategy.RemoveAll(new Predicate<ICSharpCode.TextEditor.Document.TextMarker>(delegate { return true; })); if (Editor.Document.TextLength != 0) { bool anyvisible = false; int firstmatch = int.MaxValue; string lower = Editor.Document.TextContent.ToLowerInvariant(); foreach (var word in search.require_all) { int pos = 0; var view = Editor.ActiveTextAreaControl.TextArea.TextView; int topRow = view.FirstVisibleLine; int bottomRow = topRow + view.VisibleLineCount; int leftColumn = Editor.ActiveTextAreaControl.HScrollBar.Value - Editor.ActiveTextAreaControl.HScrollBar.Minimum; int rightColumn = leftColumn + view.VisibleColumnCount; while ((pos = lower.IndexOf(word.as_lower, pos)) != -1) { Editor.Document.MarkerStrategy.AddMarker(new ICSharpCode.TextEditor.Document.TextMarker( pos, word.as_lower.Length, ICSharpCode.TextEditor.Document.TextMarkerType.SolidBlock, System.Drawing.Color.Red, System.Drawing.Color.White)); firstmatch = Math.Min(firstmatch, pos); if (!anyvisible) { int line = Editor.Document.GetLineNumberForOffset(pos); int col = pos - Editor.Document.GetLineSegmentForOffset(pos).Offset; anyvisible = (line >= topRow && line < bottomRow && col >= leftColumn && col < rightColumn); } pos += word.as_lower.Length; } } if (!anyvisible && firstmatch != int.MaxValue) { int line = Editor.Document.GetLineNumberForOffset(firstmatch); int col = firstmatch - Editor.Document.GetLineSegmentForOffset(firstmatch).Offset; Editor.ActiveTextAreaControl.ScrollTo(line, col); } } Editor.Refresh(); }
public void Search(SearchSpec search_string) { }
public void Search(SearchSpec spec) { }