Exemple #1
0
 /// <summary>
 ///     Opens the ConditionPicker Window and saves the current Inputs
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewConditionButton_Click(object sender, EventArgs e)
 {
     try
     {
         ContentChanged();
         RuleCreator.Instance.SetProperties(RuleNameTextBox.Text, RuleDescriptionTextBox.Text);
         End();
         var conditionPicker = new ConditionPicker(RuleCreator.Instance.GetRule());
     }
     catch (Exception f)
     {
         MessageBox.Show(f.ToString());
     }
 }
Exemple #2
0
 /// <summary>
 ///     Opens existing Condition
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void condiButton_Click(object sender, EventArgs e)
 {
     try
     {
         ContentChanged();
         var button = sender as Button;
         foreach (var condition in RuleCreator.Instance.GetRule().Conditions)
         {
             if (condition.Name == button.Text)
             {
                 ContentChanged();
                 RuleCreator.Instance.SetProperties(RuleNameTextBox.Text, RuleDescriptionTextBox.Text);
                 End();
                 var conditionPicker = new ConditionPicker(condition, RuleCreator.Instance.GetRule());
                 break;
             }
         }
     }
     catch (Exception f)
     {
         MessageBox.Show(f.ToString());
     }
 }