public override PropertyConstraintViolationError Validate(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag) { string text = (string)value; if (!string.IsNullOrEmpty(text) && text[text.Length - 1] == this.invalidChar) { return(new PropertyConstraintViolationError(DataStrings.ConstraintNoTrailingSpecificCharacter(text, this.invalidChar), propertyDefinition, value, this)); } return(null); }