Get object type from collection and passing it to generic class
I have created a generic TypeDescriptionProvider. I need to register this provider for a particular type during runtime. The typ开发者_如何学JAVAe is extracted from IList, So basically I have this
IList
MyTypeProvider<T>
and I need to do something like this:
TypeDescriptor.AddProvider(new MyTypeDescriptionProvider<name>(type), type);
I was able to get the T from IList as Type, but I am unable to pass it to MyTypeDescriptionProvider<>.
Thanks, Goran
Is this what you are trying to do?
精彩评论