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 |
---|---|
IPlugin |
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 |
---|---|
IPlugin |
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 |
---|---|---|
IPlugin |
pluginLocator | A plug-in locator to locate the plug-in manifest files to be loaded. |
IPlugin |
pluginStateHandler | Determines which plug-ins can or cannot be loaded. |
IPlugin |
pluginInitializer | Object that initializes plug-ins before any if its extensions is loaded. |
IPlugin |
pluginTypeLoader | Loads a specific type part of a plug-in. |
IPlugin |
pluginCache | A plug-in cache object, that can be used to restore plug-in state. |
IPlugin |
filter | A plug-in filter that controls whether certain plug-ins or individual extensions are loaded. Can be null. |
Boolean | validate | True to validate all the plug-ins detected. Specify false to ensure lazy initialization. |
IObject |
objectResolver | Add DI container to resolve objects |
Returns
Type | Description |
---|---|
IPlugin |
The newly created plug-in registry. |
Remarks
Attach an event handler to this the Plugin
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 |
---|---|---|
IPlugin |
pluginLocator | A plug-in locator to locate the plug-in manifest files to be loaded. |
IPlugin |
pluginStateHandler | Determines which plug-ins can or cannot be loaded. |
IPlugin |
pluginInitializer | Object that initializes plug-ins before any if its extensions is loaded. |
IPlugin |
pluginTypeLoader | Loads a specific type part of a plug-in. |
IPlugin |
pluginCache | A plug-in cache object, that can be used to restore plug-in state. |
Boolean | validate | True to validate all the plug-ins detected. Specify false to ensure lazy initialization. |
Returns
Type | Description |
---|---|
IPlugin |
The newly created plug-in registry. |
Remarks
Attach an event handler to this the Plugin
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 |
---|---|---|
String | pluginAssemblyReference | Assembly reference to resolve |
Returns
Type | Description |
---|---|
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 |
---|---|---|
String | pluginAssemblyReference | Assembly reference to resolve |
IFramework |
configuration | Plugin Framework configuration data |
Returns
Type | Description |
---|---|
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 |
---|---|
Event |
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.