/// <summary> /// remove broken rule from the list /// </summary> /// <param name="rule">rule</param> internal void Remove(ValidateRuleBase rule) { for (int i = Count - 1; i >= 0; i--) { if (this[i].RuleName == rule.RuleName) { RemoveAt(i); break; } } }
/// <summary> /// constructor to get rule information /// </summary> /// <param name="rule">vaidation rule</param> public BrokenRule(ValidateRuleBase rule) { _ruleName = rule.RuleName; _description = rule.Description; _propertyName = rule.PropertyName; }
/// <summary> /// Add broken rule into the list /// </summary> /// <param name="rule">rule</param> internal void Add(ValidateRuleBase rule) { Remove(rule); Add(new BrokenRule(rule)); }
/// <summary> /// Add new rule to list /// </summary> /// <param name="validationRule">validate rule</param> public void AddRules(ValidateRuleBase validationRule) { List <ValidateRuleBase> ruleList = GetPropertyRules(validationRule.PropertyName); ruleList.Add(validationRule); }