コード例 #1
0
 public MemberCache(Type baseType, IMemberContainer container)
 {
     Container = container;
     if (baseType == null)
     {
         MemberHash = new Hashtable();
     }
     else
     {
         MemberHash = SetupCache(TypeHandle.GetMemberCache(baseType));
     }
 }
コード例 #2
0
        /// <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);
        }
コード例 #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));
            }
        }