public override Dict GetAttrDict(ICallerContext context, object self) { // Get the entries from the type Dict res = new Dict(GetAttrDict(context)); // Add the entries from the instance ISuperDynamicObject sdo = self as ISuperDynamicObject; if (sdo != null) { IAttributesDictionary dict = sdo.GetDict(); if (dict != null) { foreach (KeyValuePair <object, object> val in dict) { object fieldName = val.Key; if (!res.ContainsKey(fieldName)) { res.Add(new KeyValuePair <object, object>(fieldName, val.Value)); } } } } return(res); }
internal IDictionary <object, object> GetAttrDict(ICallerContext context) { if (HaveInterfaces) { Dict res = new Dict(); foreach (DynamicType type in interfaces) { Dict dict = type.GetAttrDict(context, obj); foreach (KeyValuePair <object, object> val in dict) { if (!res.ContainsKey(val.Key)) { res.Add(val); } } } return(res); } else { return(new Dict(0)); } }
public override bool Contains(object key) { return(dict.ContainsKey(key)); }
public bool ContainsKey(TKey key) { return(dict.ContainsKey(key)); }