When I have a nested type like this:
public class MyOuter<T>
{
public class MyInner { }
}
How do I tell, using Reflection on typeof(MyInner<int>) that the type parameter T is declared on MyOuter and not on MyInner ? When I call typeof(MyOuter<int>.MyInner).GetGenericArguments() it returns an array with typeof(int) and so does typeof(MyOuter<int>).GetGenericArguments().
Aucun commentaire:
Enregistrer un commentaire