Open sandboxFocus

Method GetDerivedTypes

GetDerivedTypes(Type)

Gets the set of types derived from a given class or implementing a given interface.

Declaration
public static TypeInheritanceCodeReference[] GetDerivedTypes(Type baseType)
Parameters
Type Name Description
Type baseType

A class or interface.

Returns
Type Description
TypeInheritanceCodeReference[]

The set of types derived from or implementing baseType.

Remarks

This method returns only types defined in the assembly being currently processed.

note

This feature is available only at build time.

GetDerivedTypes(Type, ReflectionSearchOptions)

Gets the set of types derived from a given class or implementing a given interface. and specifies additional options.

Declaration
public static TypeInheritanceCodeReference[] GetDerivedTypes(Type baseType, ReflectionSearchOptions options)
Parameters
Type Name Description
Type baseType

A class or interface.

ReflectionSearchOptions options

Either IncludeTypeElement (partial type match), or IncludeDerivedTypes (deep search), but not both, or None.

Returns
Type Description
TypeInheritanceCodeReference[]

The set of types derived from or implementing baseType.

Remarks

This method returns only types defined in the assembly being currently processed.

note

This feature is available only at build time.