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); }
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); } }