Interface IPluginManagementService
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
LoadedPlugins
Indicates whether or not plugins are currently loaded
bool LoadedPlugins { get; }
Property Value
LoadingPlugins
Indicates whether or not plugins are currently being loaded
bool LoadingPlugins { get; }
Property Value
Methods
DisablePlugin(Plugin, bool)
Disables the provided plugin
void DisablePlugin(Plugin plugin, bool saveState)
Parameters
DisablePluginFeature(PluginFeature, bool)
Disables the provided plugin feature
void DisablePluginFeature(PluginFeature pluginFeature, bool saveState)
Parameters
pluginFeaturePluginFeatureThe feature to enable
saveStateboolWhether 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
pluginPluginThe plugin to enable
saveStateboolWhether or not to save the new enabled state
ignorePluginLockboolWhether 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
pluginFeaturePluginFeatureThe feature to enable
saveStateboolWhether or not to save the new enabled state
isAutoEnableboolIf 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
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
deviceIRGBDevice
Returns
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
TEither PluginFeature or a plugin type implementing PluginFeature
GetPluginByAssembly(Assembly?)
Gets the plugin that provided the specified assembly
Plugin? GetPluginByAssembly(Assembly? assembly)
Parameters
assemblyAssembly
Returns
GetPluginFromException(Exception)
Returns the plugin that threw the provided exception.
Plugin? GetPluginFromException(Exception exception)
Parameters
exceptionException
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
fileNamestringThe 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
directoryDirectoryInfoThe directory where the plugin is located
Returns
LoadPlugins(bool)
Loads all installed plugins. If plugins already loaded this will reload them all
void LoadPlugins(bool isElevated)
Parameters
isElevatedbool
RemovePlugin(Plugin, bool)
Unloads and permanently removes the provided plugin
void RemovePlugin(Plugin plugin, bool removeSettings)
Parameters
RemovePluginSettings(Plugin)
Removes the settings of a disabled plugin
void RemovePluginSettings(Plugin plugin)
Parameters
pluginPluginThe 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
pluginPluginThe 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
PluginEnabled
Occurs when a plugin has been enabled
event EventHandler<PluginEventArgs> PluginEnabled
Event Type
PluginEnabling
Occurs when a plugin is being enabled
event EventHandler<PluginEventArgs> PluginEnabling
Event Type
PluginFeatureDisabled
Occurs when a plugin feature has been disabled
event EventHandler<PluginFeatureEventArgs> PluginFeatureDisabled
Event Type
PluginFeatureEnableFailed
Occurs when a plugin feature could not be enabled
event EventHandler<PluginFeatureEventArgs> PluginFeatureEnableFailed
Event Type
PluginFeatureEnabled
Occurs when a plugin feature has been enabled
event EventHandler<PluginFeatureEventArgs> PluginFeatureEnabled
Event Type
PluginFeatureEnabling
Occurs when a plugin feature is being enabled
event EventHandler<PluginFeatureEventArgs> PluginFeatureEnabling
Event Type
PluginLoaded
Occurs when a plugin has loaded
event EventHandler<PluginEventArgs> PluginLoaded
Event Type
PluginLoading
Occurs when a plugin has started loading
event EventHandler<PluginEventArgs> PluginLoading
Event Type
PluginRemoved
Occurs when a plugin is removed
event EventHandler<PluginEventArgs> PluginRemoved
Event Type
PluginUnloaded
Occurs when a plugin has been unloaded
event EventHandler<PluginEventArgs> PluginUnloaded