예제 #1
0
 private void EditRule(Node node)
 {
     if (node.Tag is Rule)
     {
         var rule = (Rule)node.Tag;
         if (string.IsNullOrEmpty(rule.Script))
         {
             var ruleEditor = new RuleEditor(rule, false);
             ruleEditor.Location = Location;
             ruleEditor.ShowDialog();
             if (ruleEditor.Save)
             {
                 node.Tag  = rule;
                 node.Text = rule.Name;
             }
         }
         else
         {
             var scriptEditor = new ScriptEditor(rule);
             scriptEditor.Location = Location;
             scriptEditor.ShowDialog();
             if (scriptEditor.Save)
             {
                 node.Tag  = rule;
                 node.Text = rule.Name;
             }
         }
     }
 }
예제 #2
0
        private void BeComAddRuleClick(object sender, EventArgs e)
        {
            var rule       = new Rule();
            var ruleEditor = new RuleEditor(rule, false);

            ruleEditor.Location = Location;
            ruleEditor.ShowDialog();
            if (ruleEditor.Save)
            {
                rule = ruleEditor.Rule;
                if (BeTabs.SelectedTab.Name.Equals("TabCombat"))
                {
                    AddCondition(rule, BeComRules);
                }
            }
        }
예제 #3
0
        private void button_ruleList_Click(object sender, EventArgs e)
        {
            RuleEditor r = new RuleEditor();

            r.ShowDialog(Rules);
        }