예제 #1
0
파일: TypeSystem.cs 프로젝트: 2173/cshotfix
            private TypeReference LookupTypeForwarded(string @namespace, string name)
            {
                if (!this.module.HasExportedTypes)
                {
                    return(null);
                }
                Collection <ExportedType> exportedTypes = this.module.ExportedTypes;

                for (int i = 0; i < exportedTypes.Count; i++)
                {
                    ExportedType exportedType = exportedTypes[i];
                    if (exportedType.Name == name && exportedType.Namespace == @namespace)
                    {
                        return(exportedType.CreateReference());
                    }
                }
                return(null);
            }
예제 #2
0
        private static TypeDefinition GetType(ModuleDefinition module, TypeReference reference)
        {
            TypeDefinition typeDefinition = MetadataResolver.GetTypeDefinition(module, reference);

            if (typeDefinition != null)
            {
                return(typeDefinition);
            }
            if (!module.HasExportedTypes)
            {
                return(null);
            }
            Collection <ExportedType> exportedTypes = module.ExportedTypes;

            for (int i = 0; i < exportedTypes.Count; i++)
            {
                ExportedType exportedType = exportedTypes[i];
                if (!(exportedType.Name != reference.Name) && !(exportedType.Namespace != reference.Namespace))
                {
                    return(exportedType.Resolve());
                }
            }
            return(null);
        }