C
Chris McKenzie
I have a situation in which I need to test to see if an object implements a
Generic Interface. My collection contains objects which do not implement the
interface, and objects that implement the Generic Interface with different
Generic arguments. I don't care what the specific arguments are to the
Generic Interfaces.
Example:
I have a Generic Interface:
interface IMyGenericInterface<T>
{
void DoSomethingSpecial();
}
And an object collection that contains the following objects:
(0) Sytem.Object
(1) IMyGenericInterface<string>
(2) IMyGenericInterface<int>
For a specified index, I need to know if the object implements
IMyGenericInterface so that I can call DoSomethingSpecial, however, I don't
know ahead of time what Types may be used for <T>.
Anyone know how I can do this?
Thanks,
Chris McKenzie
http://weblogs.asp.net/taganov
Generic Interface. My collection contains objects which do not implement the
interface, and objects that implement the Generic Interface with different
Generic arguments. I don't care what the specific arguments are to the
Generic Interfaces.
Example:
I have a Generic Interface:
interface IMyGenericInterface<T>
{
void DoSomethingSpecial();
}
And an object collection that contains the following objects:
(0) Sytem.Object
(1) IMyGenericInterface<string>
(2) IMyGenericInterface<int>
For a specified index, I need to know if the object implements
IMyGenericInterface so that I can call DoSomethingSpecial, however, I don't
know ahead of time what Types may be used for <T>.
Anyone know how I can do this?
Thanks,
Chris McKenzie
http://weblogs.asp.net/taganov