public override ValidationResult Validate(object value, CultureInfo cultureInfo) { if (value != null && !value.Equals("")) { var uriIsValid = UriValidation.ValidateUri(value.ToString()); return(new ValidationResult(uriIsValid, null)); } return(new ValidationResult(false, null)); }
/** * */ public static byte[] PostRequest(string stringUri, NameValueCollection nameValueCollection) { Uri uri; if (!UriValidation.ValidateUri(stringUri, out uri)) { return(null); } return(PostRequest(uri, nameValueCollection)); }
public static Icon GetIconFromUrl(string uriString, int width = 32, int height = 32) { Uri uri; if (UriValidation.ValidateUri(uriString, out uri)) { return(GetIconFromUrl(uri, new Size(width, height))); } return(null); }
public override ValidationResult Validate(object value, CultureInfo cultureInfo) { if (value != null) { var prefix = value.ToString(); var prefixIsEmpty = prefix.Length == 0; var prefixIsValid = prefixIsEmpty || UriValidation.ValidateUri(prefix); return(new ValidationResult(prefixIsValid, null)); } return(new ValidationResult(false, null)); }