Exemplo n.º 1
0
        /// <summary>
        /// Adds a new declaration to goal distance rule to the rule list box, when the rule user controls fires the DataVaild event
        /// </summary>
        private void DeclarationToGoalDistanceRuleControl_DataValid()
        {
            DeclarationToGoalDistanceRule declarationToGoalDistanceRule = (plRuleControl.Controls["ruleControl"] as DeclarationToGoalDistanceRuleControl).DeclarationToGoalDistanceRule;

            if (!lbRules.Items.Contains(declarationToGoalDistanceRule))
            {
                lbRules.Items.Add(declarationToGoalDistanceRule);
            }
            Logger.Log(this, LogSeverityType.Info, $"{declarationToGoalDistanceRule} created/modified");
        }
 /// <summary>
 /// Constructor which pre-fills control from existing rule
 /// </summary>
 /// <param name="declarationToGoalDistanceRule">the existing declaration to goal distance rule</param>
 public DeclarationToGoalDistanceRuleControl(DeclarationToGoalDistanceRule declarationToGoalDistanceRule)
 {
     DeclarationToGoalDistanceRule = declarationToGoalDistanceRule;
     InitializeComponent();
     Prefill();
 }