Class PluginManager
Main entry point to the plug-in framework.
Inheritance
Namespace: Sdl.Core.PluginFramework
Assembly: Sdl.Core.PluginFramework.dll
Syntax
public static class PluginManager : Object
Properties
DefaultPluginRegistry
Returns the default plug-in registry.
Declaration
public static IPluginRegistry DefaultPluginRegistry { get; set; }
Property Value
Type | Description |
---|---|
IPluginRegistry |
Methods
CreateDefaultPluginCache()
Creates the default plug-in cache, stored in an XML file in the user's profile.
Declaration
public static IPluginCache CreateDefaultPluginCache()
Returns
Type | Description |
---|---|
IPluginCache |
CreatePluginRegistry(IPluginLocator, IPluginStateHandler, IPluginInitializer, IPluginTypeLoader, IPluginCache, IPluginFilter, Boolean, IObjectResolver)
Creates a plug-in registry containing plug-ins from the specified plugin directory.
Declaration
public static IPluginRegistry CreatePluginRegistry(IPluginLocator pluginLocator, IPluginStateHandler pluginStateHandler, IPluginInitializer pluginInitializer, IPluginTypeLoader pluginTypeLoader, IPluginCache pluginCache, IPluginFilter filter, bool validate, IObjectResolver objectResolver = null)
Parameters
Type | Name | Description |
---|---|---|
IPluginLocator | pluginLocator | A plug-in locator to locate the plug-in manifest files to be loaded. |
IPluginStateHandler | pluginStateHandler | Determines which plug-ins can or cannot be loaded. |
IPluginInitializer | pluginInitializer | Object that initializes plug-ins before any if its extensions is loaded. |
IPluginTypeLoader | pluginTypeLoader | Loads a specific type part of a plug-in. |
IPluginCache | pluginCache | A plug-in cache object, that can be used to restore plug-in state. |
IPluginFilter | filter | A plug-in filter that controls whether certain plug-ins or individual extensions are loaded. Can be null. |
System.Boolean | validate | True to validate all the plug-ins detected. Specify false to ensure lazy initialization. |
IObjectResolver | objectResolver | Add DI container to resolve objects |
Returns
Type | Description |
---|---|
IPluginRegistry | The newly created plug-in registry. |
Remarks
Attach an event handler to this the PluginLoadException even before calling this method to get notification about plug-ins that fail to load.
CreatePluginRegistry(IPluginLocator, IPluginStateHandler, IPluginInitializer, IPluginTypeLoader, IPluginCache, Boolean)
Creates a plug-in registry containing plug-ins from the specified plugin directory.
Declaration
public static IPluginRegistry CreatePluginRegistry(IPluginLocator pluginLocator, IPluginStateHandler pluginStateHandler, IPluginInitializer pluginInitializer, IPluginTypeLoader pluginTypeLoader, IPluginCache pluginCache, bool validate)
Parameters
Type | Name | Description |
---|---|---|
IPluginLocator | pluginLocator | A plug-in locator to locate the plug-in manifest files to be loaded. |
IPluginStateHandler | pluginStateHandler | Determines which plug-ins can or cannot be loaded. |
IPluginInitializer | pluginInitializer | Object that initializes plug-ins before any if its extensions is loaded. |
IPluginTypeLoader | pluginTypeLoader | Loads a specific type part of a plug-in. |
IPluginCache | pluginCache | A plug-in cache object, that can be used to restore plug-in state. |
System.Boolean | validate | True to validate all the plug-ins detected. Specify false to ensure lazy initialization. |
Returns
Type | Description |
---|---|
IPluginRegistry | The newly created plug-in registry. |
Remarks
Attach an event handler to this the PluginLoadException even before calling this method to get notification about plug-ins that fail to load.
ResolvePluginAssemblyReference(String)
Resolve the assembly reference when the version is compatible with the current installed version.
Declaration
public static string ResolvePluginAssemblyReference(string pluginAssemblyReference)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginAssemblyReference | Assembly reference to resolve |
Returns
Type | Description |
---|---|
System.String |
ResolvePluginAssemblyReference(String, IFrameworkConfiguration)
Resolve the assembly reference when the version is compatible with the current installed version.
Declaration
public static string ResolvePluginAssemblyReference(string pluginAssemblyReference, IFrameworkConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginAssemblyReference | Assembly reference to resolve |
IFrameworkConfiguration | configuration | Plugin Framework configuration data |
Returns
Type | Description |
---|---|
System.String |
Events
PluginLoadException
Raised when an exception occurs while creating a plug-in registry instance using one of the factory methods of this class.
Declaration
public static event EventHandler<PluginLoadExceptionEventArgs> PluginLoadException
Event Type
Type | Description |
---|---|
System.EventHandler<PluginLoadExceptionEventArgs> |
Remarks
Attach an event handler to this event before calling one of the factory methods of this class to get notification about plug-ins that fail to load.