public string this[string key] { get { if (!ContainsKey(key)) { return(null); } ValueItemElement item = ConfigElement.ValueItemCollection[key]; return(item != null ? item.Value : null); } set { if (!ContainsKey(key)) { ConfigElement.ValueItemCollection.Add(new ValueItemElement { Key = key, Value = value }); } else { ConfigElement.ValueItemCollection[key].Value = value; } } }
public void Add(ValueItemElement item) { if (this[item.Key] != null) { this[item.Key] = item; } else { base.BaseAdd(item); } }