View Source
Class TypeFinder
A utility class to find all classes of a certain type by reflection in the current bin folder
of the web application.
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public static class TypeFinder
Methods
View Source
FindClassesOfType<T>()
Searches all filtered local assemblies specified for classes of the type passed in.
Declaration
public static IEnumerable<Type> FindClassesOfType<T>()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
View Source
FindClassesOfType<T>(IEnumerable<Assembly>)
Returns all types found of in the assemblies specified of type T
Declaration
public static IEnumerable<Type> FindClassesOfType<T>(IEnumerable<Assembly> assemblies)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
View Source
FindClassesOfType<T>(IEnumerable<Assembly>, Boolean)
Returns all types found of in the assemblies specified of type T
Declaration
public static IEnumerable<Type> FindClassesOfType<T>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
|
System.Boolean |
onlyConcreteClasses |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
View Source
FindClassesOfTypeWithAttribute<TAttribute>(Type, IEnumerable<Assembly>, Boolean)
Finds any classes derived from the assignTypeFrom Type that contain the attribute TAttribute
Declaration
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<TAttribute>(Type assignTypeFrom, IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
where TAttribute : Attribute
Parameters
Type |
Name |
Description |
System.Type |
assignTypeFrom |
|
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
|
System.Boolean |
onlyConcreteClasses |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
Name |
Description |
TAttribute |
|
View Source
FindClassesOfTypeWithAttribute<T, TAttribute>()
Finds any classes derived from the type T that contain the attribute TAttribute
Declaration
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>()
where TAttribute : Attribute
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
Name |
Description |
T |
|
TAttribute |
|
View Source
FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly>)
Finds any classes derived from the type T that contain the attribute TAttribute
Declaration
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly> assemblies)
where TAttribute : Attribute
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
Name |
Description |
T |
|
TAttribute |
|
View Source
FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly>, Boolean)
Finds any classes derived from the type T that contain the attribute TAttribute
Declaration
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
where TAttribute : Attribute
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
|
System.Boolean |
onlyConcreteClasses |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
Name |
Description |
T |
|
TAttribute |
|
View Source
FindClassesWithAttribute(Type, IEnumerable<Assembly>, Boolean)
Finds any classes with the attribute.
Declaration
public static IEnumerable<Type> FindClassesWithAttribute(Type attributeType, IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
Parameters
Type |
Name |
Description |
System.Type |
attributeType |
The attribute type
|
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
The assemblies.
|
System.Boolean |
onlyConcreteClasses |
if set to true only concrete classes.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
View Source
FindClassesWithAttribute<T>()
Finds the classes with attribute in filtered local assemblies
Declaration
public static IEnumerable<Type> FindClassesWithAttribute<T>()
where T : Attribute
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
View Source
FindClassesWithAttribute<T>(IEnumerable<Assembly>)
Finds the classes with attribute.
Declaration
public static IEnumerable<Type> FindClassesWithAttribute<T>(IEnumerable<Assembly> assemblies)
where T : Attribute
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
The assemblies.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
View Source
FindClassesWithAttribute<T>(IEnumerable<Assembly>, Boolean)
Finds the classes with attribute.
Declaration
public static IEnumerable<Type> FindClassesWithAttribute<T>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
where T : Attribute
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
assemblies |
The assemblies.
|
System.Boolean |
onlyConcreteClasses |
if set to true only concrete classes.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
View Source
GetTypeByName(String)
Declaration
public static Type GetTypeByName(string typeName)
Parameters
Type |
Name |
Description |
System.String |
typeName |
|
Returns
Type |
Description |
System.Type |
|