Exemple #1
0
        public MemberCache(IMemberContainer container, Type baseClass, Type[] ifaces)
        {
            Container = container;

            // If we have a base class (we have a base class unless we're
            // TypeManager.object_type), we deep-copy its MemberCache here.
            if (Container.BaseCache != null)
            {
                MemberHash = SetupCache(Container.BaseCache);
            }
            else
            {
                MemberHash = new Hashtable();
            }

            if (baseClass != null)
            {
                AddCacheContents(TypeHandle.GetMemberCache(baseClass));
            }
            if (ifaces != null)
            {
                foreach (var itype in ifaces)
                {
                    var cache = TypeHandle.GetMemberCache(itype);
                    if (cache != null)
                    {
                        AddCacheContents(cache);
                    }
                }
            }
        }
Exemple #2
0
 public MemberCache(Type baseType, IMemberContainer container)
 {
     Container = container;
     if (baseType == null)
     {
         MemberHash = new Hashtable();
     }
     else
     {
         MemberHash = SetupCache(TypeHandle.GetMemberCache(baseType));
     }
 }
Exemple #3
0
        public MemberCache(Type[] ifaces)
        {
            //
            // The members of this cache all belong to other caches.
            // So, 'Container' will not be used.
            //
            Container = null;

            MemberHash = new Hashtable();
            if (ifaces == null)
            {
                return;
            }

            foreach (var itype in ifaces)
            {
                AddCacheContents(TypeHandle.GetMemberCache(itype));
            }
        }