private static string NormalizedFullName(Type type) { if (ReflectionImporter.IsNestedType(type)) { return(ReflectionImporter.NormalizedFullName(type.DeclaringType) + "/" + type.Name); } return(type.FullName); }
private TypeReference ImportType(Type type, ImportGenericContext context, ReflectionImporter.ImportGenericKind import_kind) { if (ReflectionImporter.IsTypeSpecification(type) || ReflectionImporter.ImportOpenGenericType(type, import_kind)) { return(this.ImportTypeSpecification(type, context)); } TypeReference typeReference = new TypeReference(string.Empty, type.Name, this.module, this.ImportScope(type.Assembly), type.IsValueType); typeReference.etype = ReflectionImporter.ImportElementType(type); if (ReflectionImporter.IsNestedType(type)) { typeReference.DeclaringType = this.ImportType(type.DeclaringType, context, import_kind); } else { typeReference.Namespace = (type.Namespace ?? string.Empty); } if (type.IsGenericType) { ReflectionImporter.ImportGenericParameters(typeReference, type.GetGenericArguments()); } return(typeReference); }