Table of Contents

Interface IPluginManagementService

Namespace
Artemis.Core.Services
Assembly
Artemis.Core.dll

A service providing plugin management

public interface IPluginManagementService : IDisposable
Inherited Members

Properties

AdditionalPluginDirectories

Gets a list containing additional directories in which plugins are located, used while loading plugins.

List<DirectoryInfo> AdditionalPluginDirectories { get; }

Property Value

List<DirectoryInfo>

LoadedPlugins

Indicates whether or not plugins are currently loaded

bool LoadedPlugins { get; }

Property Value

bool

LoadingPlugins

Indicates whether or not plugins are currently being loaded

bool LoadingPlugins { get; }

Property Value

bool

Methods

DisablePlugin(Plugin, bool)

Disables the provided plugin

void DisablePlugin(Plugin plugin, bool saveState)

Parameters

plugin Plugin

The plugin to disable

saveState bool

Whether or not to save the new enabled state

DisablePluginFeature(PluginFeature, bool)

Disables the provided plugin feature

void DisablePluginFeature(PluginFeature pluginFeature, bool saveState)

Parameters

pluginFeature PluginFeature

The feature to enable

saveState bool

Whether or not to save the new enabled state

EnablePlugin(Plugin, bool, bool)

Enables the provided plugin

void EnablePlugin(Plugin plugin, bool saveState, bool ignorePluginLock = false)

Parameters

plugin Plugin

The plugin to enable

saveState bool

Whether or not to save the new enabled state

ignorePluginLock bool

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

void EnablePluginFeature(PluginFeature pluginFeature, bool saveState, bool isAutoEnable = false)

Parameters

pluginFeature PluginFeature

The feature to enable

saveState bool

Whether or not to save the new enabled state

isAutoEnable bool

If true, fails if there is a lock file present

GetAllPluginInfo()

Gets the plugin info of all plugins, regardless of whether they are currently loaded

List<PluginInfo> GetAllPluginInfo()

Returns

List<PluginInfo>

A list containing all the plugin info

GetAllPlugins()

Returns a list of all loaded plugins

List<Plugin> GetAllPlugins()

Returns

List<Plugin>

A list containing all the plugin info

GetCallingPlugin()

Returns the plugin info of the current call stack

Plugin? GetCallingPlugin()

Returns

Plugin

If the current call stack contains a plugin, the plugin. Otherwise null

GetDeviceProviderByDevice(IRGBDevice)

Gets the plugin that defined the specified device

DeviceProvider GetDeviceProviderByDevice(IRGBDevice device)

Parameters

device IRGBDevice

Returns

DeviceProvider

GetFeaturesOfType<T>()

Finds all enabled PluginFeature instances of T

List<T> GetFeaturesOfType<T>() where T : PluginFeature

Returns

List<T>

Returns a list of feature instances of T

Type Parameters

T

Either PluginFeature or a plugin type implementing PluginFeature

GetPluginByAssembly(Assembly?)

Gets the plugin that provided the specified assembly

Plugin? GetPluginByAssembly(Assembly? assembly)

Parameters

assembly Assembly

Returns

Plugin

GetPluginFromException(Exception)

Returns the plugin that threw the provided exception.

Plugin? GetPluginFromException(Exception exception)

Parameters

exception Exception

Returns

Plugin

If the exception was thrown by a plugin, the plugin. Otherwise null

ImportPlugin(string)

Imports the plugin contained in the provided ZIP file

Plugin? ImportPlugin(string fileName)

Parameters

fileName string

The full path to the ZIP file that contains the plugin

Returns

Plugin

The resulting plugin

LoadPlugin(DirectoryInfo)

Loads the plugin located in the provided directory

Plugin? LoadPlugin(DirectoryInfo directory)

Parameters

directory DirectoryInfo

The directory where the plugin is located

Returns

Plugin

LoadPlugins(bool)

Loads all installed plugins. If plugins already loaded this will reload them all

void LoadPlugins(bool isElevated)

Parameters

isElevated bool

RemovePlugin(Plugin, bool)

Unloads and permanently removes the provided plugin

void RemovePlugin(Plugin plugin, bool removeSettings)

Parameters

plugin Plugin

The plugin to remove

removeSettings bool

RemovePluginSettings(Plugin)

Removes the settings of a disabled plugin

void RemovePluginSettings(Plugin plugin)

Parameters

plugin Plugin

The plugin whose settings to remove

StartHotReload()

Starts monitoring plugin directories for changes and reloads plugins when changes are detected

void StartHotReload()

UnloadPlugin(Plugin)

Unloads the provided plugin

void UnloadPlugin(Plugin plugin)

Parameters

plugin Plugin

The plugin to unload

UnloadPlugins()

Unloads all installed plugins.

void UnloadPlugins()

Events

PluginDisabled

Occurs when a plugin has been disabled

event EventHandler<PluginEventArgs> PluginDisabled

Event Type

EventHandler<PluginEventArgs>

PluginEnabled

Occurs when a plugin has been enabled

event EventHandler<PluginEventArgs> PluginEnabled

Event Type

EventHandler<PluginEventArgs>

PluginEnabling

Occurs when a plugin is being enabled

event EventHandler<PluginEventArgs> PluginEnabling

Event Type

EventHandler<PluginEventArgs>

PluginFeatureDisabled

Occurs when a plugin feature has been disabled

event EventHandler<PluginFeatureEventArgs> PluginFeatureDisabled

Event Type

EventHandler<PluginFeatureEventArgs>

PluginFeatureEnableFailed

Occurs when a plugin feature could not be enabled

event EventHandler<PluginFeatureEventArgs> PluginFeatureEnableFailed

Event Type

EventHandler<PluginFeatureEventArgs>

PluginFeatureEnabled

Occurs when a plugin feature has been enabled

event EventHandler<PluginFeatureEventArgs> PluginFeatureEnabled

Event Type

EventHandler<PluginFeatureEventArgs>

PluginFeatureEnabling

Occurs when a plugin feature is being enabled

event EventHandler<PluginFeatureEventArgs> PluginFeatureEnabling

Event Type

EventHandler<PluginFeatureEventArgs>

PluginLoaded

Occurs when a plugin has loaded

event EventHandler<PluginEventArgs> PluginLoaded

Event Type

EventHandler<PluginEventArgs>

PluginLoading

Occurs when a plugin has started loading

event EventHandler<PluginEventArgs> PluginLoading

Event Type

EventHandler<PluginEventArgs>

PluginRemoved

Occurs when a plugin is removed

event EventHandler<PluginEventArgs> PluginRemoved

Event Type

EventHandler<PluginEventArgs>

PluginUnloaded

Occurs when a plugin has been unloaded

event EventHandler<PluginEventArgs> PluginUnloaded

Event Type

EventHandler<PluginEventArgs>