Exemple #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);
 }
        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);
        }