Ejemplo n.º 1
0
        private static TypeDefinition GetType(ModuleDefinition module, TypeReference reference)
        {
            TypeDefinition typeDefinition = GetTypeDefinition(module, reference);

            if (typeDefinition != null)
            {
                return(typeDefinition);
            }
            if (module.HasExportedTypes)
            {
                Collection <ExportedType> exportedTypes = module.ExportedTypes;
                for (int i = 0; i < exportedTypes.Count; i++)
                {
                    ExportedType type = exportedTypes[i];
                    if ((type.Name == reference.Name) && (type.Namespace == reference.Namespace))
                    {
                        return(type.Resolve());
                    }
                }
            }
            return(null);
        }
        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 item = exportedTypes[i];
                if (!(item.Name != reference.Name) && !(item.Namespace != reference.Namespace))
                {
                    return(item.Resolve());
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
        public static string EnsureWellName(ExportedType et, ref string name)
        {
            if (name == null)
            {
                if (IGNORE_WELLNAMING)
                {
                    name = et.Name;
                    return name;
                }

                name = et.Resolve().WellName;
            }
            return name;
        }