Exemplo n.º 1
0
        private void ruleButton_Click(object sender, EventArgs e)
        {
            var dialog = new AddRuleDialog(ref this._rules);

            dialog.ShowDialog();

            this.ruleBox.Text = this._rules.ToString();
            dialog.Dispose();
        }
Exemplo n.º 2
0
        private void editButton_Click(object sender, EventArgs e)
        {
            var ruleStrings = new List <string>();

            foreach (var rule in this._rules.RuleList)
            {
                ruleStrings.Add(rule.FindPattern);
            }

            var editSelect = new CustomListDialog("Select Rule...", ruleStrings, "OK", "Cancel");

            if (editSelect.ShowDialog() == DialogResult.OK)
            {
                var editing    = this._rules.GetRule(editSelect.SelectedItem);
                var editDialog = new AddRuleDialog(ref this._rules, ref editing);
                if (editDialog.ShowDialog() == DialogResult.OK)
                {
                    this.ruleBox.Text = this._rules.ToString();
                }

                editDialog.Dispose();
                editSelect.Dispose();
            }
        }