Esempio n. 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));
        }
Esempio n. 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));
        }