コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OptionImpl"/> class.
 /// </summary>
 /// <param name="supplier">
 /// The function returns the string representing this option, which is
 /// actually specified with the command line.
 /// </param>
 /// <param name="spec">
 /// The specification of the option.
 /// </param>
 /// <param name="schema">
 /// The schema of the option.
 /// </param>
 /// <seealso cref="OptionSchema.Add(string, char?, string,
 /// Action{Option})"/>
 public OptionImpl(
     Func <string> supplier, OptionSpec spec, OptionSchema schema)
     : base(supplier)
 {
     Spec   = spec;
     Schema = schema;
 }
コード例 #2
0
        /// <inheritdoc/>
        public OptionSchema Add(
            string name,
            char?shortName,
            string description,
            Action <Option> action)
        {
            CheckName(name);
            CheckShortName(shortName);
            CheckDuplication(name, shortName);
            var spec = new OptionSpec(
                name, shortName, description, action);

            return(new OptionSchemaImpl(all.Append(spec)));
        }