Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
 private void BtnReset_OnClick(object sender, RoutedEventArgs e)
 {
     rtbText.Document = RichTextBoxHelper.CleanAndReformat(rtbText.Document);
 }