View Source
Class TypeFinder
Used to find objects by implemented types, names and/or attributes
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public class TypeFinder : ITypeFinder
Constructors
View Source
TypeFinder(ILogger<TypeFinder>, IAssemblyProvider, String[], ITypeFinderConfig)
Declaration
public TypeFinder(ILogger<TypeFinder> logger, IAssemblyProvider assemblyProvider, string[] additionalExlusionAssemblies, ITypeFinderConfig typeFinderConfig = null)
Parameters
View Source
TypeFinder(ILogger<TypeFinder>, IAssemblyProvider, ITypeFinderConfig)
Declaration
public TypeFinder(ILogger<TypeFinder> logger, IAssemblyProvider assemblyProvider, ITypeFinderConfig typeFinderConfig = null)
Parameters
Properties
View Source
AssembliesToScan
Return a list of found local Assemblies that Umbraco should scan for type finding
Declaration
public IEnumerable<Assembly> AssembliesToScan { get; }
Property Value
Type |
Description |
IEnumerable<System.Reflection.Assembly> |
|
Methods
View Source
FindClassesOfType(Type, Nullable<IEnumerable<Assembly>>, Boolean)
Returns all types found of in the assemblies specified of type T
Declaration
public IEnumerable<Type> FindClassesOfType(Type assignTypeFrom, IEnumerable<Assembly>? assemblies = null, bool onlyConcreteClasses = true)
Parameters
Type |
Name |
Description |
Type |
assignTypeFrom |
|
System.Nullable<IEnumerable<System.Reflection.Assembly>> |
assemblies |
|
System.Boolean |
onlyConcreteClasses |
|
Returns
Type |
Description |
IEnumerable<Type> |
|
View Source
FindClassesOfTypeWithAttribute(Type, Type, Nullable<IEnumerable<Assembly>>, Boolean)
Finds any classes derived from the assignTypeFrom Type that contain the attribute TAttribute
Declaration
public IEnumerable<Type> FindClassesOfTypeWithAttribute(Type assignTypeFrom, Type attributeType, IEnumerable<Assembly>? assemblies = null, bool onlyConcreteClasses = true)
Parameters
Type |
Name |
Description |
Type |
assignTypeFrom |
|
Type |
attributeType |
|
System.Nullable<IEnumerable<System.Reflection.Assembly>> |
assemblies |
|
System.Boolean |
onlyConcreteClasses |
|
Returns
Type |
Description |
IEnumerable<Type> |
|
View Source
FindClassesWithAttribute(Type, Nullable<IEnumerable<Assembly>>, Boolean)
Finds any classes with the attribute.
Declaration
public IEnumerable<Type> FindClassesWithAttribute(Type attributeType, IEnumerable<Assembly>? assemblies = null, bool onlyConcreteClasses = true)
Parameters
Type |
Name |
Description |
Type |
attributeType |
The attribute type
|
System.Nullable<IEnumerable<System.Reflection.Assembly>> |
assemblies |
The assemblies.
|
System.Boolean |
onlyConcreteClasses |
if set to true only concrete classes.
|
Returns
Type |
Description |
IEnumerable<Type> |
|
View Source
GetTypeByName(String)
Returns a Type for the string type name
Declaration
public virtual Type? GetTypeByName(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.Nullable<Type> |
|