Exemplo n.º 1
0
        public override PropertyConstraintViolationError Validate(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag)
        {
            IntRange intRange = value as IntRange;

            if (intRange != null && (intRange.LowerBound < this.minimumValue || intRange.UpperBound > this.maximumValue))
            {
                return(new PropertyConstraintViolationError(DataStrings.ConstraintViolationInvalidIntRange(this.minimumValue, this.maximumValue, intRange.ToString()), propertyDefinition, value, this));
            }
            return(null);
        }