Loads all available plugins and their types for service initialisation.
More...
|
| Plugin? | GetPlugin (Assembly assembly) |
| | Locates the plugin associated with the specified assembly.
|
| |
| Plugin? | GetPlugin (string pluginName) |
| | Gets the plugin from the specified name.
|
| |
| string? | GetPluginDirectory (Assembly pluginAssembly) |
| | Gets the install directory of the specified plugin.
|
| |
| bool | IsPluginAssembly (Assembly assembly) |
| | Gets if the specified assembly is the primary assembly for a plugin.
|
| |
|
bool | IsPluginLoaded (string pluginName) |
| |
| Plugin | LoadPlugin (string pluginRoot) |
| | Loads an isolated anvil plugin from the specified plugin folder at runtime.
|
| |
| WeakReference | UnloadPlugin (Plugin plugin, bool waitForUnload=true) |
| | Unloads an isolated anvil plugin at runtime.
|
| |
Loads all available plugins and their types for service initialisation.
◆ GetPlugin() [1/2]
| Plugin? Anvil.Plugins.PluginManager.GetPlugin |
( |
Assembly | assembly | ) |
|
|
inline |
Locates the plugin associated with the specified assembly.
- Parameters
-
| assembly | The assembly to search. |
- Returns
- The associated plugin, otherwise null.
◆ GetPlugin() [2/2]
| Plugin? Anvil.Plugins.PluginManager.GetPlugin |
( |
string | pluginName | ) |
|
|
inline |
Gets the plugin from the specified name.
- Returns
- The associated plugin, otherwise null.
◆ GetPluginDirectory()
| string? Anvil.Plugins.PluginManager.GetPluginDirectory |
( |
Assembly | pluginAssembly | ) |
|
|
inline |
Gets the install directory of the specified plugin.
- Parameters
-
| pluginAssembly | The assembly of the plugin, e.g. typeof(MyService).Assembly |
- Returns
- The install directory for the specified plugin.
- Exceptions
-
| ArgumentException | Thrown if the specified assembly is not a plugin. |
◆ IsPluginAssembly()
| bool Anvil.Plugins.PluginManager.IsPluginAssembly |
( |
Assembly | assembly | ) |
|
|
inline |
Gets if the specified assembly is the primary assembly for a plugin.
- Parameters
-
| assembly | The assembly to query. |
- Returns
- True if the assembly is a plugin, otherwise false.
◆ LoadPlugin()
| Plugin Anvil.Plugins.PluginManager.LoadPlugin |
( |
string | pluginRoot | ) |
|
|
inline |
Loads an isolated anvil plugin from the specified plugin folder at runtime.
- Parameters
-
| pluginRoot | The root folder containing the plugin assembly, and other resources. |
- Returns
- The loaded plugin.
- Exceptions
-
| ArgumentException | Thrown if the plugin folder/assembly is missing, or otherwise cannot be loaded. |
| InvalidOperationException | Thrown if the plugin is already loaded, or if the specified plugin is not configured as an isolated plugin. |
◆ UnloadPlugin()
| WeakReference Anvil.Plugins.PluginManager.UnloadPlugin |
( |
Plugin | plugin, |
|
|
bool | waitForUnload = true ) |
|
inline |
Unloads an isolated anvil plugin at runtime.
- Parameters
-
| plugin | The plugin to unload - see GetPlugin(string). |
| waitForUnload | If true, the server will block the current main thread until the plugin has been unloaded. |
- Returns
- A weak reference to the unloading plugin assembly. Query the WeakReference.IsAlive property to confirm the plugin has unloaded.
- Exceptions
-
| InvalidOperationException | |
The documentation for this class was generated from the following file:
- NWN.Anvil/src/main/Plugins/PluginManager.cs