Пример #1
0
 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();
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        private void uiNextButton_Click(object sender, EventArgs e)
        {
            string search = uiFindTextTextBox.Text;

            FindNext?.Invoke(this, new TextEventArgs(search));
        }
Пример #4
0
 private void btnFindNext_Click(object sender, RoutedEventArgs e)
 {
     PopulateComboBox("Find");
     FindNext?.Invoke(this, e);
 }
Пример #5
0
 public void FindPrevious()
 {
     FindNext?.Invoke(this, true);
 }
Пример #6
0
 protected virtual void OnFindNext(FindEventArgs e)
 {
     FindNext?.Invoke(this, e);
 }