In short this pretty much explains my problem ...
class Foo<T> { ... }
var type = typeof(Foo<>); <-- runtime provides a RuntimeType object instance in my real code
var paramCount = ((RuntimeType)type).GetGenericParameters().Count; <-- I need this
The problem of course is that "RuntimeType" is an internal type in (I believe) mscorlib, so I can't access it from my code.
Is there another / better way to do this?
Aucun commentaire:
Enregistrer un commentaire