I have a problem formulating a test to see if an object is implementing
a generic interface.
I have the following:
public interface IGeneric<T>
{
void Foo();
}
public class StringClass : IGeneric<string >
{
public void Foo()
{/** something**/}
}
If i happen to get a hold of an object (which could be a StringClass),
how do i check if it implements the IGeneric<interf ace, and if it
does, how do i get a hold of the fact that the generic parameter is a
string?
Thank you,
Krung
a generic interface.
I have the following:
public interface IGeneric<T>
{
void Foo();
}
public class StringClass : IGeneric<string >
{
public void Foo()
{/** something**/}
}
If i happen to get a hold of an object (which could be a StringClass),
how do i check if it implements the IGeneric<interf ace, and if it
does, how do i get a hold of the fact that the generic parameter is a
string?
Thank you,
Krung
Comment