예제 #1
0
        private void editRule_Click(object sender, EventArgs e)
        {
            var ruleViewItem = rulesListView.SelectedItems[0];
            var rule         = _rules[ruleViewItem.Index];

            var editRuleForm = new EditRuleForm(_variables, rule);

            editRuleForm.ShowDialog();

            RefreshRulesListView();
        }
예제 #2
0
        private void addRule_Click(object sender, EventArgs e)
        {
            var addRuleForm = new EditRuleForm(_variables);

            addRuleForm.OnAddRule += (conditions, conclusion) =>
            {
                var rule = new Rule(conditions, conclusion);
                _rules.Add(rule);
            };
            addRuleForm.ShowDialog();

            RefreshRulesListView();
        }