public Option(string shortopt, string longopt, string description, OptionAttributes attributes) { ShortName = shortopt; LongName = longopt; Description = description; Attributes = attributes; }
/// <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 <OPTION> 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; }
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); }
public extern static ReactElement Option(OptionAttributes properties, params ReactElementOrText[] children);
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); }
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); }