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));
        }
 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);
 }