private static string NormalizedFullName(Type type) { if (ReflectionImporter.IsNestedType(type)) { return(ReflectionImporter.NormalizedFullName(type.DeclaringType) + "/" + type.Name); } return(type.FullName); }
private static TypeReference ImportGenericParameter(Type type, ImportGenericContext context) { if (context.IsEmpty) { throw new InvalidOperationException(); } if (type.DeclaringMethod != null) { return(context.MethodParameter(type.DeclaringMethod.Name, type.GenericParameterPosition)); } if (type.DeclaringType != null) { return(context.TypeParameter(ReflectionImporter.NormalizedFullName(type.DeclaringType), type.GenericParameterPosition)); } throw new InvalidOperationException(); }