Beispiel #1
0
        private void _addRuleButton_Click(object sender, EventArgs e)
        {
            var newRule = new MatchRule();

            using (var regexForm = new RegexRuleForm(newRule))
            {
                if (regexForm.ShowDialog(this) == DialogResult.OK)
                {
                    _rulesListView.Items.Add(new RegexRuleListItem(newRule));

                    UpdateEnabledState();
                }
            }
        }
Beispiel #2
0
        private void _editRuleButton_Click(object sender, EventArgs e)
        {
            foreach (RegexRuleListItem regexItem in _rulesListView.SelectedItems)
            {
                if (regexItem == null)
                {
                    continue;
                }

                var rule = regexItem.GetRule();

                using (var regexForm = new RegexRuleForm(rule))
                {
                    if (regexForm.ShowDialog(this) == DialogResult.OK)
                    {
                        regexItem.SetRule(rule);
                    }
                }
            }
        }