S
Steve B.
Hello
I'm trying to test if an object is an instance of a class that implements a
specific interface.
I use this code :
if(!(f.GetType().IsSubclassOf(typeof(IParametrableForm))))
throw new SystemException("The form is not parametrable");
The exception is always thrown, instead the tested object actually implement
the interface :
public class frmProduct : System.Windows.Forms.Form, IParametrableForm
{
....
What's wrong with my code ?
Thanks,
Steve
I'm trying to test if an object is an instance of a class that implements a
specific interface.
I use this code :
if(!(f.GetType().IsSubclassOf(typeof(IParametrableForm))))
throw new SystemException("The form is not parametrable");
The exception is always thrown, instead the tested object actually implement
the interface :
public class frmProduct : System.Windows.Forms.Form, IParametrableForm
{
....
What's wrong with my code ?
Thanks,
Steve