Exemplo n.º 1
0
        public IEnumerable <MemberInfo> GetImportedMembers(Type type)
        {
            InitializeTypeInfoMap();

            Metadata.TypeInfo typeInfo = null;
            if (!typeInfoMap.TryGetValue(type, out typeInfo) || !typeInfo.HasImportedMembers)
            {
                return(Enumerable.Empty <MemberInfo>());
            }

            return(ResolveMemberInfo(typeInfo.ImportedMembers));
        }
Exemplo n.º 2
0
        public IEnumerable <MemberInfo> GetExportedMembers(Type type)
        {
            InitializeTypeInfoMap();

            Metadata.TypeInfo typeInfo = null;
            if (!typeInfoMap.TryGetValue(type, out typeInfo))
            {
                return(Enumerable.Empty <MemberInfo>());
            }

            var result = new HashSet <MemberInfo>();

            result.Add(type);
            ResolveMemberInfo(typeInfo.ExportedMembers, result);
            return(result);
        }
Exemplo n.º 3
0
        private TypeInfo GetOrCreateTypeInfo(TypeDefinitionHandle TypeDefinitionHandle)
        {
            TypeInfo typeInfo = null;
            if (this.compositionTypes.TryGetValue(TypeDefinitionHandle, out typeInfo))
            {
                return typeInfo;
            }

            typeInfo = new TypeInfo(isExported: false);
            typeInfo.MetadataToken = MetadataTokens.GetToken(metadataReader, TypeDefinitionHandle);

            this.compositionTypes.Add(TypeDefinitionHandle, typeInfo);
            return typeInfo;
        }