private ICommandLineOptionFluent <T> SetupInternal <T>(string shortOption, string longOption)
        {
            var argOption = this.OptionFactory.CreateOption <T>(shortOption, longOption);

            if (argOption == null)
            {
                throw new InvalidOperationException("OptionFactory is producing unexpected results.");
            }

            OptionValidator.Validate(argOption);

            this.Options.Add(argOption);

            return(argOption);
        }
コード例 #2
0
        private ICommandLineOptionFluent <T> SetupInternal <T>(string shortOption, string longOption)
        {
            var argOption = this.OptionFactory.CreateOption <T>(shortOption, longOption);

            if (argOption == null)
            {
                throw new InvalidOperationException("OptionFactory is producing unexpected results.");
            }

            OptionValidator.Validate(argOption, Parser.IsCaseSensitive ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);

            _options.Add(argOption);

            return(argOption);
        }
コード例 #3
0
 public void OptionValidatorTest()
 {
     var optionValidator      = new OptionValidator();
     var option               = new Option();
     ValidationResults result = optionValidator.Validate(option);
 }
コード例 #4
0
 public void OptionValidatorTest()
 {
     var optionValidator = new OptionValidator();
     var option = new Option();
     ValidationResults result = optionValidator.Validate(option);
 }