Search Results for

    Show / Hide Table of Contents

    Class ObjectRegistry<TExtensionAttribute, TExtensionType>

    Helper class for implementers of extension points, which allows easy instantiation of all extensions registered with an extension point identified by a specific type of extension attribute.

    Inheritance
    object
    ObjectRegistry<TExtensionAttribute, TExtensionType>
    SortedObjectRegistry<TSortableExtensionAttribute, TExtensionType>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Sdl.Core.PluginFramework
    Assembly: Sdl.Core.PluginFramework.dll
    Syntax
    public class ObjectRegistry<TExtensionAttribute, TExtensionType> where TExtensionAttribute : ExtensionAttribute where TExtensionType : class
    Type Parameters
    Name Description
    TExtensionAttribute

    The type of extension attribute, identifying the extension point.

    TExtensionType

    The type of the extension implementation classes for the extension point.

    Constructors

    ObjectRegistry(IPluginRegistry)

    Constructs an object registry for the specified extension attribute.

    Declaration
    public ObjectRegistry(IPluginRegistry pluginRegistry)
    Parameters
    Type Name Description
    IPluginRegistry pluginRegistry

    The plug-in registry from which to retrieve the extensions.

    Properties

    ExtensionPoint

    Returns the id of the extension point from which the objects should be loaded.

    Declaration
    public IExtensionPoint ExtensionPoint { get; }
    Property Value
    Type Description
    IExtensionPoint

    Methods

    CreateObjects()

    Creates an instance of all the objects registered with the extension point an returns them as an array.

    Declaration
    public virtual TExtensionType[] CreateObjects()
    Returns
    Type Description
    TExtensionType[]

    An array, containing a new instance of every object registered with the extension point.

    Exceptions
    Type Condition
    InvalidCastException

    Thrown when any of the created objects cannot be cast to the required type.

    In this article
    • Constructors
      • ObjectRegistry(IPluginRegistry)
    • Properties
      • ExtensionPoint
    • Methods
      • CreateObjects()
    Back to top Generated by DocFX