Exemple #1
0
        public static Option ValidateAsUri(this Option option, UriKind uriKind = UriKind.RelativeOrAbsolute,
                                           int parameterIndex = -1, string message = null)
        {
            var validator = new UriValidator(uriKind);

            if (message != null)
            {
                validator.Message = message;
            }
            return(option.ValidateWith(parameterIndex, validator).TypedAs <Uri>());
        }
Exemple #2
0
        public static Argument ValidateAsUri(this Argument argument, UriKind uriKind = UriKind.RelativeOrAbsolute,
                                             string message = null)
        {
            var validator = new UriValidator(uriKind);

            if (message != null)
            {
                validator.Message = message;
            }
            return(argument.ValidateWith(validator));
        }