コード例 #1
0
 /// <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;
         }
     }
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 /// <summary>
 /// Add broken rule into the list
 /// </summary>
 /// <param name="rule">rule</param>
 internal void Add(ValidateRuleBase rule)
 {
     Remove(rule);
     Add(new BrokenRule(rule));
 }
コード例 #4
0
        /// <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);
        }