void CommitSearch() { if (comboBox.Text.Length > 0) { LoggingService.Debug("FindComboBox.CommitSearch()"); SearchOptions.DocumentIteratorType = DocumentIteratorType.CurrentDocument; SearchOptions.FindPattern = comboBox.Text; SearchReplaceManager.FindNext(null); comboBox.Focus(); } }
public override void Run() { if (SearchOptions.CurrentFindPattern.Length > 0) { SearchReplaceManager.FindNext(null); } else { Find find = new Find(); find.Run(); } }
private void Button_FindNext_Click(object sender, EventArgs e) { WritebackOptions(); if (IsSelectionSearch) { if (IsTextSelected(selection)) { FindNextInSelection(); } } else { using (AsynchronousWaitDialog monitor = AsynchronousWaitDialog.ShowWaitDialog("Search", true)) { SearchReplaceManager.FindNext(monitor); } } Focus(); }
public override void Run() { ITextEditor textArea = SearchReplaceUtilities.GetActiveTextEditor(); if (textArea == null) { return; } // Determine what text we should search for. string textToFind; string selectedText = textArea.SelectedText; if (selectedText.Length > 0) { if (Find.IsMultipleLines(selectedText)) { // Locate the nearest word at the selection start. textToFind = textArea.Document.GetWordAt(textArea.SelectionStart); } else { // Search for selected text. textToFind = selectedText; } } else { textToFind = textArea.Document.GetWordAt(textArea.Caret.Offset); } if (textToFind != null && textToFind.Length > 0) { SearchOptions.CurrentFindPattern = textToFind; if (SearchOptions.DocumentIteratorType == DocumentIteratorType.CurrentSelection) { SearchOptions.DocumentIteratorType = DocumentIteratorType.CurrentDocument; } SearchReplaceManager.FindNext(null); } }
void FindNextButtonClicked(object sender, EventArgs e) { WritebackOptions(); if (IsSelectionSearch) { if (selection.IsTextSelected) { FindNextInSelection(); } } else { using (AsynchronousWaitDialog monitor = AsynchronousWaitDialog.ShowWaitDialog("Search", true)) { monitor.Progress = double.NaN; // progress not implemented, use indeterminate progress SearchReplaceManager.FindNext(monitor); } } Focus(); }