Class SortedObjectRegistry<TSortableExtensionAttribute, TExtensionType>
Helper class for implementers of extension points, which allows easy instantiation of all extensions registered with a sortable extension point (SortableExtensionAttribute) identified by a specific type of extension attribute.
Inheritance
Inherited Members
Namespace: Sdl.Core.PluginFramework.Util
Assembly: Sdl.Core.PluginFramework.dll
Syntax
public class SortedObjectRegistry<TSortableExtensionAttribute, TExtensionType> : ObjectRegistry<TSortableExtensionAttribute, TExtensionType> where TSortableExtensionAttribute : SortableExtensionAttribute where TExtensionType : class
Type Parameters
| Name | Description |
|---|---|
| TSortableExtensionAttribute | The type of sortable extension attribute, identifying the extension point. |
| TExtensionType | The type of the extension implementation classes for the extension point. |
Constructors
SortedObjectRegistry(IPluginRegistry)
Constructor.
Declaration
public SortedObjectRegistry(IPluginRegistry pluginRegistry)
Parameters
| Type | Name | Description |
|---|---|---|
| IPluginRegistry | pluginRegistry | The plug-in registry from which to retrieve the extensions. |
Methods
CreateObjects()
Creates an instance of all the objects registered with the extension point, sorts them, and returns them as an array.
Declaration
public override TExtensionType[] CreateObjects()
Returns
| Type | Description |
|---|---|
| TExtensionType[] | An array, containing a new instance of every object registered with the extension point, sorted according to the InsertBefore and InsertAfter properties. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.InvalidCastException | Thrown when any of the created objects cannot be cast to the required type. |