Exemplo n.º 1
0
        private void PatternTestView_GetPattern(object sender, GetPatternEventArgs e)
        {
            Rule rule;

            rule = DataContext as Rule;
            if (rule == null)
            {
                return;
            }
            e.Pattern        = rule.GetPattern();
            this.RulePattern = e.Pattern;
        }
Exemplo n.º 2
0
        private void TestCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            GetPatternEventArgs e2;

            e2 = new GetPatternEventArgs()
            {
                Pattern = this.Pattern
            };
            GetPattern?.Invoke(this, e2);
            try
            {
                Status = Regex.Match(textBox.Text, e2.Pattern, RegexOptions.None, TimeSpan.FromSeconds(5)).Success;
            }
            catch
            {
                Status = false;
            }
        }