void EmitBaseTypesAndAttributes(TypeDefinition typeDefinition, TypeBuilder typeBuilder)
{
foreach (TypeReference baseType in typeDefinition.BaseTypes)
{
Type type = GetSystemType(baseType);
// For some reason you can't call IsClass on constructed types created at compile time,
// so we'll ask the generic definition instead
if ((type.IsGenericType && type.GetGenericTypeDefinition().IsClass) || (type.IsClass))
{
typeBuilder.SetParent(type);
}
else
{
typeBuilder.AddInterfaceImplementation(type);
}
}
}