In C#, how can I find if a given object has a specific ancestor?
For example, say I have the following class structure.
ContainerControl
|
+----> Form
|
+--> MyNormalForm
|
+--> MyCustomFormType
|
+---> MyCustomForm
If I have a method like this:
void MyCoolMethod (Form form)
How do I find if form descends from MyCustomFormType or not?
1 Answer