using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
publicclass MainClass
{
publicstaticvoid Main()
{
PrintTypeParams(typeof(List<>));
PrintTypeParams(typeof(List<int>));
PrintTypeParams(typeof(Nullable<>));
}
privatestaticvoid PrintTypeParams(Type t)
{
Console.WriteLine(t.FullName);
foreach (Type ty in t.GetGenericArguments())
{
Console.WriteLine(ty.FullName);
Console.WriteLine(ty.IsGenericParameter);
if (ty.IsGenericParameter)
{
Type[] constraints = ty.GetGenericParameterConstraints();
foreach (Type c in constraints)
Console.WriteLine(c.FullName);
}
}
}
}