コード例 #1
0
        /// <summary>
        /// Adds a new command option if none exists.  If one does exist then
        ///     the use switch is toggled on or of.
        /// </summary>
        /// <param name="name">The common name of the option.</param>
        /// <param name="value">The option value or command line switch
        ///     of the option.</param>
        /// <param name="on"><code>true</code> if the option should be
        ///     appended to the commandline, otherwise <code>false</code>.</param>
        protected void SetCommandOption(String name, String value, bool on)
        {
            Option option;

            if (CommandOptions.Contains(name))
            {
                option = (Option)CommandOptions[name];
            }
            else
            {
                option            = new Option();
                option.OptionName = name;
                option.Value      = value;
                CommandOptions.Add(name, option);
            }
            option.IfDefined = on;
        }