private void ReplaceAllButton_Click(object sender, RoutedEventArgs e)
 {
     NextButton_Click(null, null);
     for (int i = 0; i < FindSize; i++)
     {
         LinkedEditor.Replace(new Regex(LastSearch), ComboReplace.Text, 0);
     }
     LastSearch   = null;
     CurrentIndex = 0;
     FindSize     = 0;
     LinkedEditor.EndFindAndReplace();
     if (!ReplaceHistory.Contains(ComboReplace.Text))
     {
         historyReplace.Enqueue(ComboReplace.Text);
         OnPropertyChanged("ReplaceHistory");
     }
 }
Ejemplo n.º 2
0
        private void ReplaceButton_Click(object sender, RoutedEventArgs e)
        {
            //Check if something is searched
            if (string.IsNullOrEmpty(LastSearch))
            {
                //If not, run the find button beforehand
                NextButton_Click(null, null);
            }
            MatchCollection results = LinkedEditor.Replace(new Regex(LastSearch), ComboReplace.Text, CurrentIndex);

            FindSize = results.Count;
            if (!ReplaceHistory.Contains(ComboReplace.Text))
            {
                historyReplace.Enqueue(ComboReplace.Text);
                OnPropertyChanged("ReplaceHistory");
            }
            NextButton_Click(null, null);
            LinkedEditor.Focus();
        }