Search Results for

    Show / Hide Table of Contents
    View Source

    Class TypeFinder

    Used to find objects by implemented types, names and/or attributes

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Composing
    Assembly: Umbraco.Core.dll
    Syntax
    public class TypeFinder : ITypeFinder

    Constructors

    View Source

    TypeFinder(ILogger<TypeFinder>, IAssemblyProvider, string[]?, ITypeFinderConfig?)

    Initializes a new instance of the TypeFinder class.

    Declaration
    public TypeFinder(ILogger<TypeFinder> logger, IAssemblyProvider assemblyProvider, string[]? additionalExlusionAssemblies, ITypeFinderConfig? typeFinderConfig = null)
    Parameters
    Type Name Description
    ILogger<TypeFinder> logger

    The logger instance.

    IAssemblyProvider assemblyProvider

    The assembly provider for discovering assemblies.

    string[] additionalExlusionAssemblies

    Optional additional assembly name prefixes to exclude from scanning.

    ITypeFinderConfig typeFinderConfig

    Optional type finder configuration.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when logger is null.

    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<Assembly>

    The assemblies to scan.

    Methods

    View Source

    FindClassesOfType(Type, IEnumerable<Assembly>?, bool)

    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
    IEnumerable<Assembly> assemblies
    bool onlyConcreteClasses
    Returns
    Type Description
    IEnumerable<Type>
    View Source

    FindClassesOfTypeWithAttribute(Type, Type, IEnumerable<Assembly>?, bool)

    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
    IEnumerable<Assembly> assemblies
    bool onlyConcreteClasses
    Returns
    Type Description
    IEnumerable<Type>
    View Source

    FindClassesWithAttribute(Type, IEnumerable<Assembly>?, bool)

    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

    IEnumerable<Assembly> assemblies

    The assemblies.

    bool onlyConcreteClasses

    if set to true only concrete classes.

    Returns
    Type Description
    IEnumerable<Type>
    View Source

    GetTypeByName(string)

    Gets a type by its full name.

    Declaration
    public virtual Type? GetTypeByName(string name)
    Parameters
    Type Name Description
    string name

    The full name of the type to find.

    Returns
    Type Description
    Type

    The type if found; otherwise, null.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX