コード例 #1
0
        public RuleException(BrokenRule rule)
            : base(rule.Message)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }

            this.Rule = rule;
        }
コード例 #2
0
        public int Append(BrokenRule rule)
        {
            if (rule == null || rule.Fields == null)
            {
                return(0);
            }

            // Seleciona campos nao existentes
            var fields = from i in rule.Fields
                         where this.Fields.Any(f => string.Equals(i.Name, f.Name, StringComparison.InvariantCultureIgnoreCase))
                         select i;

            this.Fields.AddRange(fields);

            return(fields.Count());
        }
コード例 #3
0
        public RuleException(string message, BrokenRule rule)
            : base(message)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }

            if (string.IsNullOrWhiteSpace(message))
            {
                message = rule.Message;
            }

            rule.Message = message;
            this.Rule    = rule;
        }
コード例 #4
0
 public RuleException(string message, Exception innerException, BrokenRule rule)
     : base(message, innerException)
 {
 }