public void Add(string key, string value) { string dataKey = Attributes.DataKey(key); Attribute attr = new Attribute(dataKey, value); enclosingAttributes.Add(dataKey, attr); }
public bool TryGetValue(string key, out string value) { string dataKey = Attributes.DataKey(key); Attribute attr; if (!String.IsNullOrEmpty(key) && enclosingAttributes.TryGetValue(dataKey, out attr)) { value = attr.Value; return(true); } value = null; return(false); }
public string this[string key] { get { if (String.IsNullOrEmpty(key)) { throw new KeyNotFoundException(); } string dataKey = Attributes.DataKey(key); Attribute attr = enclosingAttributes[dataKey]; return(attr.Value); } set { string dataKey = Attributes.DataKey(key); Attribute attr = new Attribute(dataKey, value); enclosingAttributes[dataKey] = attr; } }
public bool Remove(string key) { string dataKey = Attributes.DataKey(key); return(!String.IsNullOrEmpty(key) && enclosingAttributes.Remove(dataKey)); }
public bool ContainsKey(string key) { string dataKey = Attributes.DataKey(key); return(!String.IsNullOrEmpty(key) && enclosingAttributes.ContainsKey(dataKey)); }