コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: ComObject.cs プロジェクト: weimingtom/IronPythonMod
 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));
     }
 }
コード例 #3
0
 public override bool Contains(object key)
 {
     return(dict.ContainsKey(key));
 }
コード例 #4
0
 public bool ContainsKey(TKey key)
 {
     return(dict.ContainsKey(key));
 }