Exemplo n.º 1
0
        /// <summary>
        /// Adds a new global 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 SetGlobalOption(String name, String value, bool on)
        {
            Option option;

            Log(Level.Debug, "Name: {0}", name);
            Log(Level.Debug, "Value: {0}", value);
            Log(Level.Debug, "On: {0}", on);

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