public Exception ValidateValue( string value, string locationName, LocationKind locationKind, LocationValidationContext context) => value == "latest" || Version.TryParse(value, out _) ? null : CreateArgumentException(value, locationName, locationKind);
public Exception ValidateValue( string value, string locationName, LocationKind locationKind, LocationValidationContext context) => value == null || !string.IsNullOrEmpty(value.Trim()) ? null : CreateArgumentException(value, locationName, locationKind);
public Exception ValidateValue(float value, string locationName, LocationKind locationKind, LocationValidationContext context) { if (value < 0) { return(new ArgumentOutOfRangeException(locationName, value, "Значение не может быть меньше 0.")); } return(null); }
public Exception ValidateValue(float value, string locationName, LocationKind locationKind, LocationValidationContext context) { if (value < 0) { return(new ArgumentOutOfRangeException($"Значение {locationName} не может быть отрицательным.")); } return(null); }
public Exception ValidateValue(Rectangle value, string locationName, LocationKind locationKind, LocationValidationContext context) { if (value.Size == Point.Zero) { return(new ArgumentOutOfRangeException($"The size of {value} must not be 0.")); } else { return(null); } }
public Exception ValidateValue(Point value, string locationName, LocationKind locationKind, LocationValidationContext context) { if (value == Point.Zero) { return(new ArgumentOutOfRangeException($"The coordinates for {locationName} must not be (0, 0).")); } else { return(null); } }