/// <summary> /// <para>Initializes a new instance of the <see cref="RangeValidator{T}"/> class with fully specified /// bound constraints and a message template.</para> /// </summary> /// <param name="lowerBound">The lower bound.</param> /// <param name="lowerBoundType">The indication of how to perform the lower bound check.</param> /// <param name="upperBound">The upper bound.</param> /// <param name="upperBoundType">The indication of how to perform the upper bound check.</param> /// <param name="messageTemplate">The message template to use when logging results.</param> /// <param name="negated">True if the validator must negate the result of the validation.</param> /// <seealso cref="RangeBoundaryType"/> public RangeValidator(T lowerBound, RangeBoundaryType lowerBoundType, T upperBound, RangeBoundaryType upperBoundType, string messageTemplate, bool negated) : base(messageTemplate, null, negated) { ValidatorArgumentsValidatorHelper.ValidateRangeValidator(lowerBound, lowerBoundType, upperBound, upperBoundType); this.rangeChecker = new RangeChecker <T>(lowerBound, lowerBoundType, upperBound, upperBoundType); }
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; }
private RangeValidatorAttribute( Type boundType, object lowerBound, IComparable effectiveLowerBound, RangeBoundaryType lowerBoundType, object upperBound, IComparable effectiveUpperBound, RangeBoundaryType upperBoundType) { ValidatorArgumentsValidatorHelper.ValidateRangeValidator(effectiveLowerBound, lowerBoundType, effectiveUpperBound, upperBoundType); this.boundType = boundType; this.lowerBound = lowerBound; this.effectiveLowerBound = effectiveLowerBound; this.lowerBoundType = lowerBoundType; this.upperBound = upperBound; this.effectiveUpperBound = effectiveUpperBound; this.upperBoundType = upperBoundType; }