Ejemplo n.º 1
0
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     AIRule rule = new AIRule();
     repeat:
     foreach (AIRule i in mRules.Rules)
         if (i.ID == IDgenerator.ToString())
         {
             IDgenerator++;
             goto repeat;
         }
     rule.ID = IDgenerator.ToString();
     Commands.AddRule command = new Commands.AddRule(mRules, rule);
     mCommandManager.Execute(command);
     list.SelectedIndex = mRules.Rules.IndexOf(rule);
 }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            AIRule rule = new AIRule();

repeat:
            foreach (AIRule i in mRules.Rules)
            {
                if (i.ID == IDgenerator.ToString())
                {
                    IDgenerator++;
                    goto repeat;
                }
            }
            rule.ID = IDgenerator.ToString();
            Commands.AddRule command = new Commands.AddRule(mRules, rule);
            mCommandManager.Execute(command);
            list.SelectedIndex = mRules.Rules.IndexOf(rule);
        }