Re: Comparing Type variables

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Thu, 13 Mar 2008 23:55:36 -0700, Jeronimo Bertran <jeronimo.bertran@xxxxxxxxxxxxxxxx> wrote:

[...]
return o is typeToTest; // This won't work because typeToTest is a
variable and not the actual type but I want to be able to check if o is
derived from the type supplied.

See Type.IsInstanceOf()
http://msdn2.microsoft.com/en-us/library/system.type.isinstanceoftype.aspx

Pete
.