internal void Add(RuleMethod rule) { Remove(rule); IsReadOnly = false; Add(new BrokenRule(rule)); IsReadOnly = true; }
internal void Remove(RuleMethod rule) { // we loop through using a numeric counter because // removing items within a foreach isn't reliable IsReadOnly = false; for (int index = 0; index < Count; index++) { if (this[index].RuleName == rule.RuleName) { RemoveAt(index); break; } } IsReadOnly = true; }
internal BrokenRule(RuleMethod rule) { _ruleName = rule.RuleName; _description = rule.RuleArgs.Description; _property = rule.RuleArgs.PropertyName; }