Beispiel #1
0
        public bool Remove(string key)
        {
            _ItemBase item = Array.Find(s_items, x => x.key == key);

            if (item == null)
            {
                return(false);
            }
            item.SetValue(this, null);
            return(true);
        }
Beispiel #2
0
        public bool TryGetValue(string key, out object value)
        {
            _ItemBase item = Array.Find(s_items, x => x.key == key);

            if (item == null)
            {
                value = null;
                return(false);
            }
            value = item.GetValue(this);
            return(value != null);
        }
Beispiel #3
0
 public object this[string key]
 {
     get
     {
         _ItemBase item = Array.Find(s_items, x => x.key == key);
         if (item == null)
         {
             return(null);
         }
         return(item.GetValue(this));
     }
     set
     {
         _ItemBase item = Array.Find(s_items, x => x.key == key);
         if (item == null)
         {
             throw new Exception("not have such key " + key);
         }
         item.SetValue(this, value);
     }
 }