Esempio n. 1
0
        private void BtnCheck_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Validate() == false)
                {
                    return;
                }

                rtbText.Document = RichTextBoxHelper.CleanAndReformat(rtbText.Document);

                var regex = tbGeneratedPattern.Text;

                var ranges = RichTextBoxMatchFinder.FindMatches(rtbText.Document, new Regex(regex, RegexOptions.Singleline | RegexOptions.IgnoreCase));

                RichTextBoxMatchFinder.HighlightMatches(ranges, Colors.Red, FontWeights.Bold);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
 private void BtnReset_OnClick(object sender, RoutedEventArgs e)
 {
     rtbText.Document = RichTextBoxHelper.CleanAndReformat(rtbText.Document);
 }