Esempio n. 1
0
        private static bool TryGetDefinition(ModuleDefinition module, TypeParser.Type type_info, out TypeReference type)
        {
            type = null;
            if (!TypeParser.TryCurrentModule(module, type_info))
            {
                return(false);
            }
            TypeDefinition typeDefinition = module.GetType(type_info.type_fullname);

            if (typeDefinition == null)
            {
                return(false);
            }
            string[] nested_names = type_info.nested_names;
            if (!nested_names.IsNullOrEmpty <string>())
            {
                for (int i = 0; i < nested_names.Length; i++)
                {
                    TypeDefinition nestedType = typeDefinition.GetNestedType(nested_names[i]);
                    if (nestedType == null)
                    {
                        return(false);
                    }
                    typeDefinition = nestedType;
                }
            }
            type = typeDefinition;
            return(true);
        }