ModuleManager
Overview
The ModuleManager class is a core class for the .NET host applications. This class is used by host applications to load and manage plugin modules. For more information about creating host applications please refere to this article.
Use Case
You will use this class in your .NET host applications to deal with plugins, for example:
private void Main_Load(object sender, EventArgs e)
{
moduleManager.LoadModule("Plugin.dll");
Instance = moduleManager.CreateInstance("MyPlugin");
hostPanel1.HostPlugin(Instance as IBasePlugin);
}
Location
- Reference: RemObjects.Hydra.Host.dll
- Namespace: RemObjects.Hydra
- Ancestry: Component | ModuleManager
constructor
Creates an instance of the class.
constructor
ModuleManager()
init()
Sub New()
CreateInstance (String): IHYCrossPlatformPlugin
method CreateInstance(name: String): IHYCrossPlatformPlugin
IHYCrossPlatformPlugin CreateInstance(String name)
func CreateInstance(_ name: String) -> IHYCrossPlatformPlugin
Function CreateInstance(name As String) As IHYCrossPlatformPlugin
Parameters:
- name:
CreateInstance (PluginDescriptor): IHYCrossPlatformPlugin
Loads managed plugin module with given file name.
method CreateInstance(pluginDescriptor: PluginDescriptor): IHYCrossPlatformPlugin
IHYCrossPlatformPlugin CreateInstance(PluginDescriptor pluginDescriptor)
func CreateInstance(_ pluginDescriptor: PluginDescriptor) -> IHYCrossPlatformPlugin
Function CreateInstance(pluginDescriptor As PluginDescriptor) As IHYCrossPlatformPlugin
Parameters:
- pluginDescriptor: Reference to a module.
Host
Gets or sets reference to a host object. Setting this referece will allow module manager to assign it to every module that is being loaded and to every instance that you will create.
property Host: IHYCrossPlatformHost read write;
IHYCrossPlatformHost Host { get; set; }
var Host: IHYCrossPlatformHost { get{} set{} }
Property Host() As IHYCrossPlatformHost
LoadComModule (Guid): LoadedComModule
method LoadComModule(aGuid: Guid): LoadedComModule
LoadedComModule LoadComModule(Guid aGuid)
func LoadComModule(_ aGuid: Guid) -> LoadedComModule
Function LoadComModule(aGuid As Guid) As LoadedComModule
Parameters:
- aGuid:
LoadComModule (String): LoadedComModule
method LoadComModule(aGuid: String): LoadedComModule
LoadedComModule LoadComModule(String aGuid)
func LoadComModule(_ aGuid: String) -> LoadedComModule
Function LoadComModule(aGuid As String) As LoadedComModule
Parameters:
- aGuid:
LoadFiremonkeyModule
Loads a FireMonkey plugin module.
method LoadFiremonkeyModule(filename: String): LoadedFiremonkeyModule
LoadedFiremonkeyModule LoadFiremonkeyModule(String filename)
func LoadFiremonkeyModule(_ filename: String) -> LoadedFiremonkeyModule
Function LoadFiremonkeyModule(filename As String) As LoadedFiremonkeyModule
Parameters:
- filename: Path to a plugin module.
LoadJavaModule
method LoadJavaModule(filename: String): LoadedJavaModule
LoadedJavaModule LoadJavaModule(String filename)
func LoadJavaModule(_ filename: String) -> LoadedJavaModule
Function LoadJavaModule(filename As String) As LoadedJavaModule
Parameters:
- filename:
LoadManagedModule (array of Byte): LoadedManagedModule
Loads managed plugin module from the array. Deprecated only for backward compatibility.
method LoadManagedModule(aAssembly: array of Byte): LoadedManagedModule
LoadedManagedModule LoadManagedModule(Byte[] aAssembly)
func LoadManagedModule(_ aAssembly: Byte...) -> LoadedManagedModule
Function LoadManagedModule(aAssembly As Byte()) As LoadedManagedModule
Parameters:
- aAssembly: A byte array that is a COFF-based image containing an emitted assembly.
LoadManagedModule (Assembly): LoadedManagedModule
Loads managed plugin module from a pre-loaded assembly.
method LoadManagedModule(aAssembly: Assembly): LoadedManagedModule
LoadedManagedModule LoadManagedModule(Assembly aAssembly)
func LoadManagedModule(_ aAssembly: Assembly) -> LoadedManagedModule
Function LoadManagedModule(aAssembly As Assembly) As LoadedManagedModule
Parameters:
- aAssembly: Reference to a pre-loaded assembly.
LoadManagedModule (String): LoadedManagedModule
method LoadManagedModule(filename: String): LoadedManagedModule
LoadedManagedModule LoadManagedModule(String filename)
func LoadManagedModule(_ filename: String) -> LoadedManagedModule
Function LoadManagedModule(filename As String) As LoadedManagedModule
Parameters:
- filename:
LoadManagedModule (String, Boolean): LoadedManagedModule
method LoadManagedModule(filename: String; inNewAppDomain: Boolean): LoadedManagedModule
LoadedManagedModule LoadManagedModule(String filename, Boolean inNewAppDomain)
func LoadManagedModule(_ filename: String, _ inNewAppDomain: Boolean) -> LoadedManagedModule
Function LoadManagedModule(filename As String, inNewAppDomain As Boolean) As LoadedManagedModule
Parameters:
- filename:
- inNewAppDomain:
LoadModule (String): LoadedModule
method LoadModule(filename: String): LoadedModule
LoadedModule LoadModule(String filename)
func LoadModule(_ filename: String) -> LoadedModule
Function LoadModule(filename As String) As LoadedModule
Parameters:
- filename:
LoadModule (String, Boolean): LoadedModule
method LoadModule(filename: String; inNewAppDomain: Boolean): LoadedModule
LoadedModule LoadModule(String filename, Boolean inNewAppDomain)
func LoadModule(_ filename: String, _ inNewAppDomain: Boolean) -> LoadedModule
Function LoadModule(filename As String, inNewAppDomain As Boolean) As LoadedModule
Parameters:
- filename:
- inNewAppDomain:
LoadSilverlightModule
method LoadSilverlightModule(filename: String): LoadedSilverlightModule
LoadedSilverlightModule LoadSilverlightModule(String filename)
func LoadSilverlightModule(_ filename: String) -> LoadedSilverlightModule
Function LoadSilverlightModule(filename As String) As LoadedSilverlightModule
Parameters:
- filename:
LoadUnmanagedModule
method LoadUnmanagedModule(filename: String): LoadedUnmanagedModule
LoadedUnmanagedModule LoadUnmanagedModule(String filename)
func LoadUnmanagedModule(_ filename: String) -> LoadedUnmanagedModule
Function LoadUnmanagedModule(filename As String) As LoadedUnmanagedModule
Parameters:
- filename:
ModuleLoaded
This event is fired when the module is loaded.
event ModuleLoaded: EventHandler<ModuleLoadedEventArgs>
delegate EventHandler<ModuleLoadedEventArgs> ModuleLoaded()
__event EventHandler<ModuleLoadedEventArgs>: ModuleLoaded!
Event ModuleLoaded As EventHandler<ModuleLoadedEventArgs>
ModuleLoading
This event is fired before loading the module.
event ModuleLoading: EventHandler<ModuleLoadingEventArgs>
delegate EventHandler<ModuleLoadingEventArgs> ModuleLoading()
__event EventHandler<ModuleLoadingEventArgs>: ModuleLoading!
Event ModuleLoading As EventHandler<ModuleLoadingEventArgs>
Modules
Collection of all modules that are loaded into the current ModuleManager.
property Modules: ICollection read;
ICollection Modules { get; }
var Modules: ICollection { get{} }
ReadOnly Property Modules() As ICollection
Plugins
List of all plugin descriptors contained in plugin modules.
property Plugins: PluginList read;
PluginList Plugins { get; }
var Plugins: PluginList { get{} }
ReadOnly Property Plugins() As PluginList
TryLoadModule
method TryLoadModule(filename: String): LoadedModule
LoadedModule TryLoadModule(String filename)
func TryLoadModule(_ filename: String) -> LoadedModule
Function TryLoadModule(filename As String) As LoadedModule
Parameters:
- filename:
UnloadModule
Loads managed plugin module with given file name.
method UnloadModule(module: LoadedModule)
void UnloadModule(LoadedModule module)
func UnloadModule(_ module: LoadedModule)
Sub UnloadModule(module As LoadedModule)
Parameters:
- module: Reference to a module.
Host
Gets or sets reference to a host object. Setting this referece will allow module manager to assign it to every module that is being loaded and to every instance that you will create.
property Host: IHYCrossPlatformHost read write;
IHYCrossPlatformHost Host { get; set; }
var Host: IHYCrossPlatformHost { get{} set{} }
Property Host() As IHYCrossPlatformHost
Modules
Collection of all modules that are loaded into the current ModuleManager.
property Modules: ICollection read;
ICollection Modules { get; }
var Modules: ICollection { get{} }
ReadOnly Property Modules() As ICollection
Plugins
List of all plugin descriptors contained in plugin modules.
property Plugins: PluginList read;
PluginList Plugins { get; }
var Plugins: PluginList { get{} }
ReadOnly Property Plugins() As PluginList
constructor
Creates an instance of the class.
constructor
ModuleManager()
init()
Sub New()
CreateInstance (String): IHYCrossPlatformPlugin
method CreateInstance(name: String): IHYCrossPlatformPlugin
IHYCrossPlatformPlugin CreateInstance(String name)
func CreateInstance(_ name: String) -> IHYCrossPlatformPlugin
Function CreateInstance(name As String) As IHYCrossPlatformPlugin
Parameters:
- name:
CreateInstance (PluginDescriptor): IHYCrossPlatformPlugin
Loads managed plugin module with given file name.
method CreateInstance(pluginDescriptor: PluginDescriptor): IHYCrossPlatformPlugin
IHYCrossPlatformPlugin CreateInstance(PluginDescriptor pluginDescriptor)
func CreateInstance(_ pluginDescriptor: PluginDescriptor) -> IHYCrossPlatformPlugin
Function CreateInstance(pluginDescriptor As PluginDescriptor) As IHYCrossPlatformPlugin
Parameters:
- pluginDescriptor: Reference to a module.
LoadComModule (Guid): LoadedComModule
method LoadComModule(aGuid: Guid): LoadedComModule
LoadedComModule LoadComModule(Guid aGuid)
func LoadComModule(_ aGuid: Guid) -> LoadedComModule
Function LoadComModule(aGuid As Guid) As LoadedComModule
Parameters:
- aGuid:
LoadComModule (String): LoadedComModule
method LoadComModule(aGuid: String): LoadedComModule
LoadedComModule LoadComModule(String aGuid)
func LoadComModule(_ aGuid: String) -> LoadedComModule
Function LoadComModule(aGuid As String) As LoadedComModule
Parameters:
- aGuid:
LoadFiremonkeyModule
Loads a FireMonkey plugin module.
method LoadFiremonkeyModule(filename: String): LoadedFiremonkeyModule
LoadedFiremonkeyModule LoadFiremonkeyModule(String filename)
func LoadFiremonkeyModule(_ filename: String) -> LoadedFiremonkeyModule
Function LoadFiremonkeyModule(filename As String) As LoadedFiremonkeyModule
Parameters:
- filename: Path to a plugin module.
LoadJavaModule
method LoadJavaModule(filename: String): LoadedJavaModule
LoadedJavaModule LoadJavaModule(String filename)
func LoadJavaModule(_ filename: String) -> LoadedJavaModule
Function LoadJavaModule(filename As String) As LoadedJavaModule
Parameters:
- filename:
LoadManagedModule (array of Byte): LoadedManagedModule
Loads managed plugin module from the array. Deprecated only for backward compatibility.
method LoadManagedModule(aAssembly: array of Byte): LoadedManagedModule
LoadedManagedModule LoadManagedModule(Byte[] aAssembly)
func LoadManagedModule(_ aAssembly: Byte...) -> LoadedManagedModule
Function LoadManagedModule(aAssembly As Byte()) As LoadedManagedModule
Parameters:
- aAssembly: A byte array that is a COFF-based image containing an emitted assembly.
LoadManagedModule (Assembly): LoadedManagedModule
Loads managed plugin module from a pre-loaded assembly.
method LoadManagedModule(aAssembly: Assembly): LoadedManagedModule
LoadedManagedModule LoadManagedModule(Assembly aAssembly)
func LoadManagedModule(_ aAssembly: Assembly) -> LoadedManagedModule
Function LoadManagedModule(aAssembly As Assembly) As LoadedManagedModule
Parameters:
- aAssembly: Reference to a pre-loaded assembly.
LoadManagedModule (String): LoadedManagedModule
method LoadManagedModule(filename: String): LoadedManagedModule
LoadedManagedModule LoadManagedModule(String filename)
func LoadManagedModule(_ filename: String) -> LoadedManagedModule
Function LoadManagedModule(filename As String) As LoadedManagedModule
Parameters:
- filename:
LoadManagedModule (String, Boolean): LoadedManagedModule
method LoadManagedModule(filename: String; inNewAppDomain: Boolean): LoadedManagedModule
LoadedManagedModule LoadManagedModule(String filename, Boolean inNewAppDomain)
func LoadManagedModule(_ filename: String, _ inNewAppDomain: Boolean) -> LoadedManagedModule
Function LoadManagedModule(filename As String, inNewAppDomain As Boolean) As LoadedManagedModule
Parameters:
- filename:
- inNewAppDomain:
LoadModule (String): LoadedModule
method LoadModule(filename: String): LoadedModule
LoadedModule LoadModule(String filename)
func LoadModule(_ filename: String) -> LoadedModule
Function LoadModule(filename As String) As LoadedModule
Parameters:
- filename:
LoadModule (String, Boolean): LoadedModule
method LoadModule(filename: String; inNewAppDomain: Boolean): LoadedModule
LoadedModule LoadModule(String filename, Boolean inNewAppDomain)
func LoadModule(_ filename: String, _ inNewAppDomain: Boolean) -> LoadedModule
Function LoadModule(filename As String, inNewAppDomain As Boolean) As LoadedModule
Parameters:
- filename:
- inNewAppDomain:
LoadSilverlightModule
method LoadSilverlightModule(filename: String): LoadedSilverlightModule
LoadedSilverlightModule LoadSilverlightModule(String filename)
func LoadSilverlightModule(_ filename: String) -> LoadedSilverlightModule
Function LoadSilverlightModule(filename As String) As LoadedSilverlightModule
Parameters:
- filename:
LoadUnmanagedModule
method LoadUnmanagedModule(filename: String): LoadedUnmanagedModule
LoadedUnmanagedModule LoadUnmanagedModule(String filename)
func LoadUnmanagedModule(_ filename: String) -> LoadedUnmanagedModule
Function LoadUnmanagedModule(filename As String) As LoadedUnmanagedModule
Parameters:
- filename:
TryLoadModule
method TryLoadModule(filename: String): LoadedModule
LoadedModule TryLoadModule(String filename)
func TryLoadModule(_ filename: String) -> LoadedModule
Function TryLoadModule(filename As String) As LoadedModule
Parameters:
- filename:
UnloadModule
Loads managed plugin module with given file name.
method UnloadModule(module: LoadedModule)
void UnloadModule(LoadedModule module)
func UnloadModule(_ module: LoadedModule)
Sub UnloadModule(module As LoadedModule)
Parameters:
- module: Reference to a module.
ModuleLoaded
This event is fired when the module is loaded.
event ModuleLoaded: EventHandler<ModuleLoadedEventArgs>
delegate EventHandler<ModuleLoadedEventArgs> ModuleLoaded()
__event EventHandler<ModuleLoadedEventArgs>: ModuleLoaded!
Event ModuleLoaded As EventHandler<ModuleLoadedEventArgs>
ModuleLoading
This event is fired before loading the module.
event ModuleLoading: EventHandler<ModuleLoadingEventArgs>
delegate EventHandler<ModuleLoadingEventArgs> ModuleLoading()
__event EventHandler<ModuleLoadingEventArgs>: ModuleLoading!
Event ModuleLoading As EventHandler<ModuleLoadingEventArgs>