Class PluginHost
Simplic plugin host.
Inheritance
System.Object
PluginHost
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Plugin
Assembly: Simplic.Plugin.Host.dll
Syntax
public class PluginHost
Constructors
| Improve this Doc View SourcePluginHost(String, String)
This constructor takes parameters, creates a MEF catalog and looks for dll files in pluginDirectory
matching the searchPattern
.
Declaration
public PluginHost(string pluginDirectory, string searchPattern)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginDirectory | The directory to look for the plugins |
System.String | searchPattern | A search pattern to filter out plugin dlls. |
Properties
| Improve this Doc View SourceIsComposed
Declaration
public bool IsComposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceAddAssembly(String)
Declaration
public bool AddAssembly(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName |
Returns
Type | Description |
---|---|
System.Boolean |
AddDirectory(String, String)
Adds a directory to be loaded later
Declaration
public bool AddDirectory(string newDirectory, string searchPattern)
Parameters
Type | Name | Description |
---|---|---|
System.String | newDirectory | |
System.String | searchPattern |
Returns
Type | Description |
---|---|
System.Boolean |
ComposeParts()
Declaration
public void ComposeParts()
GetPluginById(Guid)
Searches for a plugin with the given ID and returns it.
Declaration
public IPlugin GetPluginById(Guid pluginId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | pluginId |
Returns
Type | Description |
---|---|
IPlugin | A Plugin |
GetPluginByName(String)
Searches for a plugin with the given name and returns it.
Declaration
public IPlugin GetPluginByName(string pluginName)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginName | Plugin name to look for |
Returns
Type | Description |
---|---|
IPlugin | A Plugin |
InitAll()
This method would iterate through all the loaded plugins and call their Init() method.
Declaration
public void InitAll()
RunAll()
This method would iterate through all the loaded plugins and call their Run() method.
Declaration
public void RunAll()