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;
 }
        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 dateTime  = this.generator.GenerateBoundDateTime(lowerBound, lowerUnit, now);
            DateTime dateTime2 = this.generator.GenerateBoundDateTime(upperBound, upperUnit, now);

            this.rangeChecker = new RangeChecker <DateTime>(dateTime, lowerBoundType, dateTime2, upperBoundType);
        }