Interface IPluginManagementService
A service providing plugin management
Inherited Members
Namespace: Artemis.Core.Services
Assembly: Artemis.Core.dll
Syntax
public interface IPluginManagementService : IDisposable
Properties
LoadingPlugins
Indicates whether or not plugins are currently being loaded
Declaration
bool LoadingPlugins { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
CopyBuiltInPlugins()
Copy built-in plugins from the executable directory to the plugins directory if the version is higher (higher or equal if compiled as debug)
Declaration
void CopyBuiltInPlugins()
DequeuePluginDeletion(Plugin)
Removes the provided plugin for the deletion queue it was added to via QueuePluginDeletion(Plugin)
Declaration
void DequeuePluginDeletion(Plugin plugin)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin to dequeue |
DisablePlugin(Plugin, bool)
Disables the provided plugin
Declaration
void DisablePlugin(Plugin plugin, bool saveState)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin to disable |
bool | saveState | Whether or not to save the new enabled state |
DisablePluginFeature(PluginFeature, bool)
Disables the provided plugin feature
Declaration
void DisablePluginFeature(PluginFeature pluginFeature, bool saveState)
Parameters
Type | Name | Description |
---|---|---|
PluginFeature | pluginFeature | The feature to enable |
bool | saveState | Whether or not to save the new enabled state |
EnablePlugin(Plugin, bool, bool)
Enables the provided plugin
Declaration
void EnablePlugin(Plugin plugin, bool saveState, bool ignorePluginLock = false)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin to enable |
bool | saveState | Whether or not to save the new enabled state |
bool | ignorePluginLock | Whether or not plugin lock files should be ignored. If set to true, plugins with lock files will load successfully |
EnablePluginFeature(PluginFeature, bool, bool)
Enables the provided plugin feature
Declaration
void EnablePluginFeature(PluginFeature pluginFeature, bool saveState, bool isAutoEnable = false)
Parameters
Type | Name | Description |
---|---|---|
PluginFeature | pluginFeature | The feature to enable |
bool | saveState | Whether or not to save the new enabled state |
bool | isAutoEnable | If true, fails if there is a lock file present |
GetAllPlugins()
Gets the plugin info of all loaded plugins
Declaration
List<Plugin> GetAllPlugins()
Returns
Type | Description |
---|---|
List<Plugin> | A list containing all the plugin info |
GetCallingPlugin()
Returns the plugin info of the current call stack
Declaration
Plugin? GetCallingPlugin()
Returns
Type | Description |
---|---|
Plugin | If the current call stack contains a plugin, the plugin. Otherwise null |
GetDeviceProviderByDevice(IRGBDevice)
Gets the plugin that defined the specified device
Declaration
DeviceProvider GetDeviceProviderByDevice(IRGBDevice device)
Parameters
Type | Name | Description |
---|---|---|
IRGBDevice | device |
Returns
Type | Description |
---|---|
DeviceProvider |
GetFeaturesOfType<T>()
Finds all enabled PluginFeature instances of T
Declaration
List<T> GetFeaturesOfType<T>() where T : PluginFeature
Returns
Type | Description |
---|---|
List<T> | Returns a list of feature instances of |
Type Parameters
Name | Description |
---|---|
T | Either PluginFeature or a plugin type implementing PluginFeature |
GetPluginByAssembly(Assembly?)
Gets the plugin that provided the specified assembly
Declaration
Plugin? GetPluginByAssembly(Assembly? assembly)
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly |
Returns
Type | Description |
---|---|
Plugin |
GetPluginFromException(Exception)
Returns the plugin that threw the provided exception.
Declaration
Plugin? GetPluginFromException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception |
Returns
Type | Description |
---|---|
Plugin | If the exception was thrown by a plugin, the plugin. Otherwise null |
ImportPlugin(string)
Imports the plugin contained in the provided ZIP file
Declaration
Plugin? ImportPlugin(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The full path to the ZIP file that contains the plugin |
Returns
Type | Description |
---|---|
Plugin | The resulting plugin |
LoadPlugin(DirectoryInfo)
Loads the plugin located in the provided directory
Declaration
Plugin? LoadPlugin(DirectoryInfo directory)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | directory | The directory where the plugin is located |
Returns
Type | Description |
---|---|
Plugin |
LoadPlugins(bool)
Loads all installed plugins. If plugins already loaded this will reload them all
Declaration
void LoadPlugins(bool isElevated)
Parameters
Type | Name | Description |
---|---|---|
bool | isElevated |
QueuePluginDeletion(Plugin)
Queues the provided plugin to be deleted the next time Artemis starts, before plugins are loaded
Declaration
void QueuePluginDeletion(Plugin plugin)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin to delete |
RemovePlugin(Plugin, bool)
Unloads and permanently removes the provided plugin
Declaration
void RemovePlugin(Plugin plugin, bool removeSettings)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin to remove |
bool | removeSettings |
RemovePluginSettings(Plugin)
Removes the settings of a disabled plugin
Declaration
void RemovePluginSettings(Plugin plugin)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin whose settings to remove |
UnloadPlugin(Plugin)
Unloads the provided plugin
Declaration
void UnloadPlugin(Plugin plugin)
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin to unload |
UnloadPlugins()
Unloads all installed plugins.
Declaration
void UnloadPlugins()
Events
CopyingBuildInPlugins
Occurs when built-in plugins are being loaded
Declaration
event EventHandler CopyingBuildInPlugins
Event Type
Type | Description |
---|---|
EventHandler |
PluginDisabled
Occurs when a plugin has been disabled
Declaration
event EventHandler<PluginEventArgs> PluginDisabled
Event Type
Type | Description |
---|---|
EventHandler<PluginEventArgs> |
PluginEnabled
Occurs when a plugin has been enabled
Declaration
event EventHandler<PluginEventArgs> PluginEnabled
Event Type
Type | Description |
---|---|
EventHandler<PluginEventArgs> |
PluginEnabling
Occurs when a plugin is being enabled
Declaration
event EventHandler<PluginEventArgs> PluginEnabling
Event Type
Type | Description |
---|---|
EventHandler<PluginEventArgs> |
PluginFeatureDisabled
Occurs when a plugin feature has been disabled
Declaration
event EventHandler<PluginFeatureEventArgs> PluginFeatureDisabled
Event Type
Type | Description |
---|---|
EventHandler<PluginFeatureEventArgs> |
PluginFeatureEnableFailed
Occurs when a plugin feature could not be enabled
Declaration
event EventHandler<PluginFeatureEventArgs> PluginFeatureEnableFailed
Event Type
Type | Description |
---|---|
EventHandler<PluginFeatureEventArgs> |
PluginFeatureEnabled
Occurs when a plugin feature has been enabled
Declaration
event EventHandler<PluginFeatureEventArgs> PluginFeatureEnabled
Event Type
Type | Description |
---|---|
EventHandler<PluginFeatureEventArgs> |
PluginFeatureEnabling
Occurs when a plugin feature is being enabled
Declaration
event EventHandler<PluginFeatureEventArgs> PluginFeatureEnabling
Event Type
Type | Description |
---|---|
EventHandler<PluginFeatureEventArgs> |
PluginLoaded
Occurs when a plugin has loaded
Declaration
event EventHandler<PluginEventArgs> PluginLoaded
Event Type
Type | Description |
---|---|
EventHandler<PluginEventArgs> |
PluginLoading
Occurs when a plugin has started loading
Declaration
event EventHandler<PluginEventArgs> PluginLoading
Event Type
Type | Description |
---|---|
EventHandler<PluginEventArgs> |
PluginUnloaded
Occurs when a plugin has been unloaded
Declaration
event EventHandler<PluginEventArgs> PluginUnloaded
Event Type
Type | Description |
---|---|
EventHandler<PluginEventArgs> |