public override void Validate(SAObject obj, object property) { object otherProperty = obj.GetType().GetProperty(_propertyName).GetValue(obj, null); if(property == null) { obj.Invalidate(ErrorMessage); } else if(property.ToString() != otherProperty.ToString()) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { object otherProperty = obj.GetType().GetProperty(_propertyName).GetValue(obj, null); if(property == null) { obj.Invalidate(ErrorMessage); } else if(Convert.ToDouble(property) >= Convert.ToDouble(otherProperty)) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { if((property == null) || (!new Regex(RegEx).IsMatch(property.ToString()))) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { if(((property == null) && (MinimumLength > 0)) || (property.ToString().Length < MinimumLength)) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { if(property == null) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { if((property == null) || (String.IsNullOrWhiteSpace(property as string))) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { if(property is String) { if(property.ToString().Length > MaximumLength) { obj.Invalidate(ErrorMessage); } } }
public override void Validate(SAObject obj, object property) { if(property.IsNumericType()) { if((Convert.ToDouble(property) < Convert.ToDouble(MinimumValue)) || (Convert.ToDouble(property) > Convert.ToDouble(MaximumValue))) { obj.Invalidate(ErrorMessage); } } }
public override void Validate(SAObject obj, object property) { if(property is String) { if(!property.ToString().All(Char.IsLetter)) { obj.Invalidate(ErrorMessage); } } }