private void btnFind_Click(object sender, EventArgs e) { if (tbSearchText.Text != string.Empty) { SearchText = tbSearchText.Text; MatchCase = cbMatchCase.Checked; FindPrevious = cbFindPrev.Checked; FindNext?.Invoke(this, e); } else { System.Media.SystemSounds.Beep.Play(); } }
public void Replace() { IEditor ce = GetCurrentEditor(); if (ce == null) { return; } // if currently selected text matches -> replace; anyways, find the next match Regex r = GetRegEx(); string s = ce.Text.Substring(ce.SelectionStart, ce.SelectionLength); // CE.SelectedText; Match m = r.Match(s); if (m.Success && m.Index == 0 && m.Length == s.Length) { ce.Replace(ce.SelectionStart, ce.SelectionLength, ReplacementText); //CE.SelectedText = ReplacementText; } FindNext?.Invoke(this, false); }
private void uiNextButton_Click(object sender, EventArgs e) { string search = uiFindTextTextBox.Text; FindNext?.Invoke(this, new TextEventArgs(search)); }
private void btnFindNext_Click(object sender, RoutedEventArgs e) { PopulateComboBox("Find"); FindNext?.Invoke(this, e); }
public void FindPrevious() { FindNext?.Invoke(this, true); }
protected virtual void OnFindNext(FindEventArgs e) { FindNext?.Invoke(this, e); }