예제 #1
0
 public ContainsCharactersValidator(string characterSet, ContainsCharacters containsCharacters, string messageTemplate, bool negated)
     : base(messageTemplate, (string)null, negated)
 {
     ValidatorArgumentsValidatorHelper.ValidateContainsCharacterValidator(characterSet);
     this.characterSet       = characterSet;
     this.containsCharacters = containsCharacters;
 }
예제 #2
0
 internal RegexValidatorAttribute(string pattern, string patternResourceName, Type patternResourceType, RegexOptions options)
 {
     ValidatorArgumentsValidatorHelper.ValidateRegexValidator(pattern, patternResourceName, patternResourceType);
     this.pattern             = pattern;
     this.options             = options;
     this.patternResourceName = patternResourceName;
     this.patternResourceType = patternResourceType;
 }
예제 #3
0
 private RangeValidatorAttribute(IComparable lowerBound, RangeBoundaryType lowerBoundType, IComparable upperBound, RangeBoundaryType upperBoundType)
 {
     ValidatorArgumentsValidatorHelper.ValidateRangeValidator(lowerBound, lowerBoundType, upperBound, upperBoundType);
     this.lowerBound     = lowerBound;
     this.lowerBoundType = lowerBoundType;
     this.upperBound     = upperBound;
     this.upperBoundType = upperBoundType;
 }
예제 #4
0
 public RegexValidator(string pattern, string patternResourceName, Type patternResourceType, RegexOptions options, string messageTemplate, bool negated) : base(messageTemplate, null, negated)
 {
     ValidatorArgumentsValidatorHelper.ValidateRegexValidator(pattern, patternResourceName, patternResourceType);
     this.pattern             = pattern;
     this.options             = options;
     this.patternResourceName = patternResourceName;
     this.patternResourceType = patternResourceType;
 }
예제 #5
0
 public RelativeDateTimeValidatorAttribute(int lowerBound, DateTimeUnit lowerUnit, RangeBoundaryType lowerBoundType, int upperBound, DateTimeUnit upperUnit, RangeBoundaryType upperBoundType)
 {
     ValidatorArgumentsValidatorHelper.ValidateRelativeDatimeValidator(lowerBound, lowerUnit, lowerBoundType, upperBound, upperUnit, upperBoundType);
     this.lowerBound     = lowerBound;
     this.lowerUnit      = lowerUnit;
     this.lowerBoundType = lowerBoundType;
     this.upperBound     = upperBound;
     this.upperUnit      = upperUnit;
     this.upperBoundType = upperBoundType;
 }
예제 #6
0
        public RelativeDateTimeValidator(int lowerBound, DateTimeUnit lowerUnit, RangeBoundaryType lowerBoundType, int upperBound, DateTimeUnit upperUnit, RangeBoundaryType upperBoundType, string messageTemplate, bool negated) : base(messageTemplate, null, negated)
        {
            ValidatorArgumentsValidatorHelper.ValidateRelativeDatimeValidator(lowerBound, lowerUnit, lowerBoundType, upperBound, upperUnit, upperBoundType);
            this.lowerBound = lowerBound;
            this.lowerUnit  = lowerUnit;
            this.upperBound = upperBound;
            this.upperUnit  = upperUnit;
            this.generator  = new RelativeDateTimeGenerator();
            DateTime now   = DateTime.Now;
            DateTime time2 = this.generator.GenerateBoundDateTime(lowerBound, lowerUnit, now);
            DateTime time3 = this.generator.GenerateBoundDateTime(upperBound, upperUnit, now);

            this.rangeChecker = new RangeChecker <DateTime>(time2, lowerBoundType, time3, upperBoundType);
        }
예제 #7
0
 public DomainValidator(IEnumerable <T> domain, string messageTemplate, bool negated) : base(messageTemplate, null, negated)
 {
     ValidatorArgumentsValidatorHelper.ValidateDomainValidator(domain);
     this.domain = domain;
 }
예제 #8
0
 public DomainValidatorAttribute(params object[] domain)
 {
     ValidatorArgumentsValidatorHelper.ValidateDomainValidator(domain);
     this.domain = domain;
 }
예제 #9
0
 public EnumConversionValidator(Type enumType, string messageTemplate, bool negated) : base(messageTemplate, null, negated)
 {
     ValidatorArgumentsValidatorHelper.ValidateEnumConversionValidator(enumType);
     this.enumType = enumType;
 }
 public EnumConversionValidatorAttribute(Type enumType)
 {
     ValidatorArgumentsValidatorHelper.ValidateEnumConversionValidator(enumType);
     this.enumType = enumType;
 }
 public ContainsCharactersValidatorAttribute(string characterSet, ContainsCharacters containsCharacters)
 {
     ValidatorArgumentsValidatorHelper.ValidateContainsCharacterValidator(characterSet);
     this.characterSet       = characterSet;
     this.containsCharacters = containsCharacters;
 }
 public TypeConversionValidator(Type targetType, string messageTemplate, bool negated) : base(messageTemplate, null, negated)
 {
     ValidatorArgumentsValidatorHelper.ValidateTypeConversionValidator(targetType);
     this.targetType = targetType;
 }
예제 #13
0
 public RangeValidator(T lowerBound, RangeBoundaryType lowerBoundType, T upperBound, RangeBoundaryType upperBoundType, string messageTemplate, bool negated)
     : base(messageTemplate, (string)null, negated)
 {
     ValidatorArgumentsValidatorHelper.ValidateRangeValidator((IComparable)(object)lowerBound, lowerBoundType, (IComparable)(object)upperBound, upperBoundType);
     this.rangeChecker = new RangeChecker <T>(lowerBound, lowerBoundType, upperBound, upperBoundType);
 }
예제 #14
0
 public TypeConversionValidatorAttribute(Type targetType)
 {
     ValidatorArgumentsValidatorHelper.ValidateTypeConversionValidator(targetType);
     this.targetType = targetType;
 }