Is there a way to get code like this print “Test”;
DecendedTextBox myControl = new DecendedTextbox();
if (myControl is "TextBox")
{
Debug.WriteLine("Test");
}
The point here is that I need to see if myControl inherits from a type that I don’t have a reference to at Compile Time.
If you don’t have a reference to the type, you can do this:
If you want to know the full type name, including namespace, you can use
GetType().FullNameAs far as checking to see if it inherits from the type, something like this:
Note that Type.GetType takes an AssemblyQualifiedName, so you’ll need to know the full type name.