Category Archives: inheritance

Find class ancestors in C#

The example Find classes that implement an interface or that are descendants of a given class in C# shows how to find a list of classes that are descendants of a class or interface. This example uses similar code to … Continue reading

Posted in classes, inheritance, interfaces, reflection | Tagged , , , , , , , , , , , , , , , | Leave a comment

Find classes that implement an interface or that are descendants of a given class in C#

This example lets you find classes that are part of an inheritance or implementation hierarchy. When you enter a class or interface name and click Find, the example uses the following code to search the currently loaded assemblies for classes … Continue reading

Posted in classes, inheritance, interfaces, reflection | Tagged , , , , , , , , , , , , , , | 1 Comment

Provide multiple inheritance in C#

Sometimes you might want a class to inherit from more than one parent class. For example, you might define a Vehicle class that has vehicle properties such as MaxSpeed, and a Domicile class with house-like properties such as SquareFeet. You … Continue reading

Posted in inheritance, interfaces, OOP | Tagged , , , , , , , , , | 1 Comment