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();
                }
            }
        }
        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);
                    }
                }
            }
        }