예제 #1
0
        public static Option ValidateFromList(this Option option, IEnumerable <string> items, bool caseSensitive = false,
                                              int parameterIndex = -1, string message = null)
        {
            var validator = new LookupValidator(items);

            if (message != null)
            {
                validator.Message = message;
            }
            return(option.ValidateWith(validator));
        }
예제 #2
0
        public static Argument ValidateFromList(this Argument argument, IEnumerable <string> items,
                                                bool caseSensitive = false, string message = null)
        {
            var validator = new LookupValidator(items);

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