public MemberCache(Type baseType, IMemberContainer container) { Container = container; if (baseType == null) { MemberHash = new Hashtable(); } else { MemberHash = SetupCache(TypeHandle.GetMemberCache(baseType)); } }
/// <summary> /// Lookup a TypeHandle instance for the given type. If the type doesn't have /// a TypeHandle yet, a new instance of it is created. This static method /// ensures that we'll only have one TypeHandle instance per type. /// </summary> private static TypeHandle GetTypeHandle(Type t) { var handle = (TypeHandle)_typeHash[t]; if (handle != null) { return(handle); } handle = new TypeHandle(t); _typeHash.Add(t, handle); return(handle); }
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)); } }