internal override string Validate(object value) {
if (maxLength < 0) {
maxLength = Convert.ToInt32(properties["maxLength"]);
if (maxLength < 0) throw new Exception("Validator maxLength must be >= 0");
}
var s = value as string;
if (s == null) return null;
if (s.Length > maxLength) {
return "String length must not exceed " + maxLength;
}
return null;
}
}