/// <summary> /// Create new ObjectOptionItem with given name and no initial value set. /// </summary> /// <remarks>The option is enabled by default.</remarks> /// <param name="name">The canonical (non-localized) name of the option</param> /// <param name="attributes">An optional map of attributes for the item</param> protected OptionItem(string name, IDictionary <string, object> attributes) { if (String.IsNullOrEmpty(name)) { throw new ArgumentNullException("name", "Name must not be null or empty"); } this.name = name; this.attributes = attributes; Value = null; lookup = Lookups.CreateDictionaryLookup(dictionary); }
/// <summary> /// Create new ObjectOptionItem with given name and no initial value set. /// </summary> /// <remarks>The option is enabled by default.</remarks> /// <param name="name">The canonical (non-localized) name of the option</param> public OptionItem(string name) { if (name == null) { throw new ArgumentNullException("name", "Name must not be null"); } this.name = name; attributes = new Dictionary <string, object>(); attributesMapper = new DictionaryMapper <string, object>(attributes); //by default, null values and undefined values are supported attributes[SupportNullValueAttribute] = true; attributes[SupportUndefinedValueAttribute] = true; attributes[NullValueStringAttribute] = "(null)"; Value = null; lookup = Lookups.CreateDictionaryLookup(dictionary); }