ThrowIfNotUri Method
Definition
ThrowIfNotUri(string, UriKind, string, string)
Validates and throws an ArgumentException if the specified argument does not have the format of a Uri.
public static void ThrowIfNotUri(string argument, UriKind uriKind = UriKind.Absolute, string message = "Value must be a URI.", string paramName = null)
Parameters
argumentstringThe value to be evaluated.
uriKindUriKindThe type of the URI.
messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentException
argumentmust be a Uri.- ArgumentOutOfRangeException
uriKindwas set to an indeterminate value of RelativeOrAbsolute.