Category Archives: inheritance

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 , , , , , , , , , | Leave a comment

Find the ancestors of classes in the program’s loaded assemblies 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 | Leave a comment

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

When you enter a class or interface name and click Find, this example uses the following code to search the currently loaded assemblies for classes that are descendants of the class or interface. private void btnFind_Click(object sender, EventArgs e) { … Continue reading

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