/// <summary> /// Adds a new marker to goal distance rule to the rule list box, when the rule user controls fires the DataVaild event /// </summary> private void MarkerToGoalDistanceRuleControl_DataValid() { MarkerToGoalDistanceRule markerToGoalDistanceRule = (plRuleControl.Controls["ruleControl"] as MarkerToGoalDistanceRuleControl).MarkerToGoalDistanceRule; if (!lbRules.Items.Contains(markerToGoalDistanceRule)) { lbRules.Items.Add(markerToGoalDistanceRule); } Log(LogSeverityType.Info, $"{markerToGoalDistanceRule} created/modified"); }
/// <summary> /// Constructor which pre-fills control from existing rule /// </summary> /// <param name="markerToGoalDistanceRule">the existing marker to goal distance rule</param> public MarkerToGoalDistanceRuleControl(MarkerToGoalDistanceRule markerToGoalDistanceRule) { MarkerToGoalDistanceRule = markerToGoalDistanceRule; InitializeComponent(); Prefill(); }