Beispiel #1
0
            public void Add(string key, string value)
            {
                string    dataKey = Attributes.DataKey(key);
                Attribute attr    = new Attribute(dataKey, value);

                enclosingAttributes.Add(dataKey, attr);
            }
Beispiel #2
0
            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);
            }
Beispiel #3
0
 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;
     }
 }
Beispiel #4
0
            public bool Remove(string key)
            {
                string dataKey = Attributes.DataKey(key);

                return(!String.IsNullOrEmpty(key) && enclosingAttributes.Remove(dataKey));
            }
Beispiel #5
0
            public bool ContainsKey(string key)
            {
                string dataKey = Attributes.DataKey(key);

                return(!String.IsNullOrEmpty(key) && enclosingAttributes.ContainsKey(dataKey));
            }