Object representing a validation rule for an object
 /// <summary>
 /// Removes a broken rule from the list
 /// </summary>
 /// <param name="rule"><see cref="ValidationRuleInfo"/> object containing the details about the rule.</param>
 internal void Remove(ValidationRuleInfo rule)
 {
     for (int index = Count - 1; index >= 0; index--)
     {
         if (this[index].RuleName == rule.RuleName)
         {
             RemoveAt(index);
             break;
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Creates a instance of the object.
 /// </summary>
 /// <param name="rule"><see cref="ValidationRuleInfo"/> containing the details about the rule that was broken.</param>
 internal BrokenRule(ValidationRuleInfo rule)
 {
     _ruleName    = rule.RuleName;
     _description = rule.ValidationRuleArgs.Description;
     _property    = rule.ValidationRuleArgs.PropertyName;
 }
 /// <summary>
 /// Add a broken rule to the list
 /// </summary>
 /// <param name="rule"><see cref="ValidationRuleInfo"/> object containing the details about the rule.</param>
 internal void Add(ValidationRuleInfo rule)
 {
     Remove(rule);
     Add(new BrokenRule(rule));
 }
Exemple #4
0
 /// <summary>
 /// Creates a instance of the object.
 /// </summary>
 /// <param name="rule"><see cref="ValidationRuleInfo"/> containing the details about the rule that was broken.</param>
 internal BrokenRule(ValidationRuleInfo rule)
 {
    _ruleName = rule.RuleName;
    _description = rule.ValidationRuleArgs.Description;
    _property = rule.ValidationRuleArgs.PropertyName;
 }