示例#1
0
 public Option(string shortopt, string longopt, string description, OptionAttributes attributes)
 {
     ShortName   = shortopt;
     LongName    = longopt;
     Description = description;
     Attributes  = attributes;
 }
示例#2
0
        /// <summary>
        /// Populates poll's results
        /// </summary>
        /// <param name="userStatus">User status (e.g. anonymous; signed-in)</param>
        /// <param name="response">Response index</param>
        /// <param name="key">Attribute name</param>
        /// <param name="value">Attribute value</param>
        /// <remarks>Collection later used by the code which generates xml. Attribute keys and values will end up as &lt;OPTION&gt; element xml attributes (key="value")</remarks>
		public void Add(Poll.UserStatus userStatus, int response, string key, string value)
        {
            Options pollOptions;
            bool exists = _results.TryGetValue(userStatus, out pollOptions); 
            if (!exists)
            {
                pollOptions = new Options();
                _results.Add(userStatus, pollOptions); 
            }

            OptionAttributes optionAttributes;
            exists = pollOptions.TryGetValue(response, out optionAttributes);
            if (!exists)
            {
                optionAttributes = new OptionAttributes();
                pollOptions.Add(response, optionAttributes); 
            }

            // If key does not exist then new key/value pair added.
            optionAttributes[key] = value; 
        }
示例#3
0
 public MultiValueOption(string shortopt, string longopt, string description, OptionAttributes attributes, Action <TEnvironment, string[]> handler)
     : base(shortopt, longopt, description, attributes)
 {
     this.Handler = (env, args) => handler(env, args);
 }
示例#4
0
 public extern static ReactElement Option(OptionAttributes properties, params ReactElementOrText[] children);
示例#5
0
        public Option <TEnvironment> Add(string shortopt, string longopt, string description, Action <TEnvironment, string[]> action, OptionAttributes attributes)
        {
            var p = new MultiValueOption <TEnvironment>(shortopt, longopt, description, attributes, action);

            Options.Add(p);
            return(p);
        }
示例#6
0
        public Option <TEnvironment> Add(string shortopt, string longopt, string description, Action <TEnvironment, string> handler, OptionAttributes attributes)
        {
            var p = new SingleValueOption <TEnvironment>(shortopt, longopt, description, attributes, handler);

            Options.Add(p);
            return(p);
        }