private void OnEditRuleButtonClick(object sender, EventArgs e)
        {
            var row = RuleListView.SelectedItems[0];

            var original = (Config.RuleItem)row.Tag;

            var copy = original.Clone();

            using (var form = new RuleForm(copy))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    DrawRuleListItem(row, copy);

                    for (var itemIndex = 0; itemIndex < EditValue.Rule.Length; itemIndex++)
                    {
                        if (ReferenceEquals(original, EditValue.Rule[itemIndex]))
                        {
                            EditValue.Rule[itemIndex] = copy;

                            break;
                        }
                    }

                    HasChanged = true;
                }
            }
        }
        private void OnAddRuleButtonClick(object sender, EventArgs e)
        {
            var newItem = new Config.RuleItem();

            using (var form = new RuleForm(newItem))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    var list = (EditValue.Rule ?? Enumerable.Empty <Config.RuleItem>()).ToList();

                    list.Add(newItem);

                    EditValue.Rule = list.ToArray();

                    AddRuleListRow(newItem);

                    HasChanged = true;
                }
            }
        }