Пример #1
0
 private void SelectResult(TextRange range)
 {
     TextLocation p1 = Query.Document.OffsetToPosition(range.Offset);
     TextLocation p2 = Query.Document.OffsetToPosition(range.Offset + range.Length);
     Query.ActiveTextAreaControl.SelectionManager.SetSelection(p1, p2);
     Query.ActiveTextAreaControl.ScrollTo(p1.Line, p1.Column);
     Query.ActiveTextAreaControl.Caret.Position = Query.Document.OffsetToPosition(range.Offset + range.Length);
 }
Пример #2
0
 private void SelectResult(TextRange range)
 {
     TextLocation p1 = _editor.Document.OffsetToPosition(range.Offset);
     TextLocation p2 = _editor.Document.OffsetToPosition(range.Offset + range.Length);
     _editor.ActiveTextAreaControl.SelectionManager.SetSelection(p1, p2);
     _editor.ActiveTextAreaControl.ScrollTo(p1.Line, p1.Column);
     // Also move the caret to the end of the selection, because when the user
     // presses F3, the caret is where we start searching next time.
     _editor.ActiveTextAreaControl.Caret.Position =
         _editor.Document.OffsetToPosition(range.Offset + range.Length);
 }