TypeExtensions.GetAllSubClassesOf(Type, Assembly[]) Method

Definition

Returns a list of types for all classes that extend from the current type and are not abstract

public static System.Collections.Generic.List<Type> GetAllSubClassesOf (this Type rootType, System.Reflection.Assembly[] searchAssemblies = default);
static member GetAllSubClassesOf : Type * System.Reflection.Assembly[] -> System.Collections.Generic.List<Type>
<Extension()>
Public Function GetAllSubClassesOf (rootType As Type, Optional searchAssemblies As Assembly() = Nothing) As List(Of Type)

Parameters

rootType
Type

The class type from which to search for inherited classes

searchAssemblies
Assembly[]

List of assemblies to search through for types. If null, default is to grab all assemblies in current app domain

Returns

Null if rootType is not a class, otherwise returns list of types for sub-classes of rootType

Applies to