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

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