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


 

constructor

Creates an instance of the class.

 

constructor

 

ModuleManager()

 

Sub New()

add_ModuleLoaded

 

method add_ModuleLoaded(value: EventHandler<ModuleLoadedEventArgs>)

 

void add_ModuleLoaded(EventHandler<ModuleLoadedEventArgs> value)

 

Sub add_ModuleLoaded(value As EventHandler<ModuleLoadedEventArgs>)

Parameters:

  • value:

add_ModuleLoading

 

method add_ModuleLoading(value: EventHandler<ModuleLoadingEventArgs>)

 

void add_ModuleLoading(EventHandler<ModuleLoadingEventArgs> value)

 

Sub add_ModuleLoading(value As EventHandler<ModuleLoadingEventArgs>)

Parameters:

  • value:

 

method CreateInstance(pluginDescriptor: PluginDescriptor): IHYCrossPlatformPlugin

 

IHYCrossPlatformPlugin CreateInstance(PluginDescriptor pluginDescriptor)

 

Function CreateInstance(pluginDescriptor As PluginDescriptor) As IHYCrossPlatformPlugin

Parameters:

  • pluginDescriptor:

CreateInstance (String): IHYCrossPlatformPlugin

 

method CreateInstance(name: String): IHYCrossPlatformPlugin

 

IHYCrossPlatformPlugin CreateInstance(String name)

 

Function CreateInstance(name As String) As IHYCrossPlatformPlugin

Parameters:

  • name:

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; }

 

Property Host() As IHYCrossPlatformHost

LoadFiremonkeyModule

Loads a FireMonkey plugin module.

 

method LoadFiremonkeyModule(filename: String): LoadedFiremonkeyModule

 

LoadedFiremonkeyModule LoadFiremonkeyModule(String filename)

 

Function LoadFiremonkeyModule(filename As String) As LoadedFiremonkeyModule

Parameters:

  • filename: Path to a plugin module.

LoadJavaModule

 

method LoadJavaModule(filename: String): LoadedJavaModule

 

LoadedJavaModule LoadJavaModule(String filename)

 

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)

 

Function LoadManagedModule(aAssembly As Byte()) As LoadedManagedModule

Parameters:

  • aAssembly: A byte array that is a COFF-based image containing an emitted assembly.

LoadManagedModule (String): LoadedManagedModule

 

method LoadManagedModule(filename: String): LoadedManagedModule

 

LoadedManagedModule LoadManagedModule(String filename)

 

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)

 

Function LoadManagedModule(filename As String, inNewAppDomain As Boolean) As LoadedManagedModule

Parameters:

  • filename:
  • inNewAppDomain:

LoadManagedModule (Assembly): LoadedManagedModule

Loads managed plugin module from a pre-loaded assembly.

 

method LoadManagedModule(aAssembly: Assembly): LoadedManagedModule

 

LoadedManagedModule LoadManagedModule(Assembly aAssembly)

 

Function LoadManagedModule(aAssembly As Assembly) As LoadedManagedModule

Parameters:

  • aAssembly: Reference to a pre-loaded assembly.

LoadModule (String): LoadedModule

 

method LoadModule(filename: String): LoadedModule

 

LoadedModule LoadModule(String filename)

 

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)

 

Function LoadModule(filename As String, inNewAppDomain As Boolean) As LoadedModule

Parameters:

  • filename:
  • inNewAppDomain:

LoadSilverlightModule

 

method LoadSilverlightModule(filename: String): LoadedSilverlightModule

 

LoadedSilverlightModule LoadSilverlightModule(String filename)

 

Function LoadSilverlightModule(filename As String) As LoadedSilverlightModule

Parameters:

  • filename:

LoadUnmanagedModule

 

method LoadUnmanagedModule(filename: String): LoadedUnmanagedModule

 

LoadedUnmanagedModule LoadUnmanagedModule(String filename)

 

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 ModuleLoaded As EventHandler<ModuleLoadedEventArgs>

ModuleLoading

This event is fired before loading the module.

 

event ModuleLoading: EventHandler<ModuleLoadingEventArgs>;

 

delegate 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; }

 

ReadOnly Property Modules() As ICollection

Plugins

List of all plugin descriptors contained in plugin modules.

 

property Plugins: PluginList read;

 

PluginList Plugins { get; }

 

ReadOnly Property Plugins() As PluginList

remove_ModuleLoaded

 

method remove_ModuleLoaded(value: EventHandler<ModuleLoadedEventArgs>)

 

void remove_ModuleLoaded(EventHandler<ModuleLoadedEventArgs> value)

 

Sub remove_ModuleLoaded(value As EventHandler<ModuleLoadedEventArgs>)

Parameters:

  • value:

remove_ModuleLoading

 

method remove_ModuleLoading(value: EventHandler<ModuleLoadingEventArgs>)

 

void remove_ModuleLoading(EventHandler<ModuleLoadingEventArgs> value)

 

Sub remove_ModuleLoading(value As EventHandler<ModuleLoadingEventArgs>)

Parameters:

  • value:

TryLoadModule

 

method TryLoadModule(filename: String): LoadedModule

 

LoadedModule TryLoadModule(String filename)

 

Function TryLoadModule(filename As String) As LoadedModule

Parameters:

  • filename:

UnloadModule

 

method UnloadModule(module: LoadedModule)

 

void UnloadModule(LoadedModule module)

 

Sub UnloadModule(module As LoadedModule)

Parameters:

  • 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; }

 

Property Host() As IHYCrossPlatformHost

Modules

Collection of all modules that are loaded into the current ModuleManager.

 

property Modules: ICollection read;

 

ICollection Modules { get; }

 

ReadOnly Property Modules() As ICollection

Plugins

List of all plugin descriptors contained in plugin modules.

 

property Plugins: PluginList read;

 

PluginList Plugins { get; }

 

ReadOnly Property Plugins() As PluginList

 

constructor

Creates an instance of the class.

 

constructor

 

ModuleManager()

 

Sub New()

add_ModuleLoaded

 

method add_ModuleLoaded(value: EventHandler<ModuleLoadedEventArgs>)

 

void add_ModuleLoaded(EventHandler<ModuleLoadedEventArgs> value)

 

Sub add_ModuleLoaded(value As EventHandler<ModuleLoadedEventArgs>)

Parameters:

  • value:

add_ModuleLoading

 

method add_ModuleLoading(value: EventHandler<ModuleLoadingEventArgs>)

 

void add_ModuleLoading(EventHandler<ModuleLoadingEventArgs> value)

 

Sub add_ModuleLoading(value As EventHandler<ModuleLoadingEventArgs>)

Parameters:

  • value:

 

method CreateInstance(pluginDescriptor: PluginDescriptor): IHYCrossPlatformPlugin

 

IHYCrossPlatformPlugin CreateInstance(PluginDescriptor pluginDescriptor)

 

Function CreateInstance(pluginDescriptor As PluginDescriptor) As IHYCrossPlatformPlugin

Parameters:

  • pluginDescriptor:

CreateInstance (String): IHYCrossPlatformPlugin

 

method CreateInstance(name: String): IHYCrossPlatformPlugin

 

IHYCrossPlatformPlugin CreateInstance(String name)

 

Function CreateInstance(name As String) As IHYCrossPlatformPlugin

Parameters:

  • name:

LoadFiremonkeyModule

Loads a FireMonkey plugin module.

 

method LoadFiremonkeyModule(filename: String): LoadedFiremonkeyModule

 

LoadedFiremonkeyModule LoadFiremonkeyModule(String filename)

 

Function LoadFiremonkeyModule(filename As String) As LoadedFiremonkeyModule

Parameters:

  • filename: Path to a plugin module.

LoadJavaModule

 

method LoadJavaModule(filename: String): LoadedJavaModule

 

LoadedJavaModule LoadJavaModule(String filename)

 

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)

 

Function LoadManagedModule(aAssembly As Byte()) As LoadedManagedModule

Parameters:

  • aAssembly: A byte array that is a COFF-based image containing an emitted assembly.

LoadManagedModule (String): LoadedManagedModule

 

method LoadManagedModule(filename: String): LoadedManagedModule

 

LoadedManagedModule LoadManagedModule(String filename)

 

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)

 

Function LoadManagedModule(filename As String, inNewAppDomain As Boolean) As LoadedManagedModule

Parameters:

  • filename:
  • inNewAppDomain:

LoadManagedModule (Assembly): LoadedManagedModule

Loads managed plugin module from a pre-loaded assembly.

 

method LoadManagedModule(aAssembly: Assembly): LoadedManagedModule

 

LoadedManagedModule LoadManagedModule(Assembly aAssembly)

 

Function LoadManagedModule(aAssembly As Assembly) As LoadedManagedModule

Parameters:

  • aAssembly: Reference to a pre-loaded assembly.

LoadModule (String): LoadedModule

 

method LoadModule(filename: String): LoadedModule

 

LoadedModule LoadModule(String filename)

 

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)

 

Function LoadModule(filename As String, inNewAppDomain As Boolean) As LoadedModule

Parameters:

  • filename:
  • inNewAppDomain:

LoadSilverlightModule

 

method LoadSilverlightModule(filename: String): LoadedSilverlightModule

 

LoadedSilverlightModule LoadSilverlightModule(String filename)

 

Function LoadSilverlightModule(filename As String) As LoadedSilverlightModule

Parameters:

  • filename:

LoadUnmanagedModule

 

method LoadUnmanagedModule(filename: String): LoadedUnmanagedModule

 

LoadedUnmanagedModule LoadUnmanagedModule(String filename)

 

Function LoadUnmanagedModule(filename As String) As LoadedUnmanagedModule

Parameters:

  • filename:

remove_ModuleLoaded

 

method remove_ModuleLoaded(value: EventHandler<ModuleLoadedEventArgs>)

 

void remove_ModuleLoaded(EventHandler<ModuleLoadedEventArgs> value)

 

Sub remove_ModuleLoaded(value As EventHandler<ModuleLoadedEventArgs>)

Parameters:

  • value:

remove_ModuleLoading

 

method remove_ModuleLoading(value: EventHandler<ModuleLoadingEventArgs>)

 

void remove_ModuleLoading(EventHandler<ModuleLoadingEventArgs> value)

 

Sub remove_ModuleLoading(value As EventHandler<ModuleLoadingEventArgs>)

Parameters:

  • value:

TryLoadModule

 

method TryLoadModule(filename: String): LoadedModule

 

LoadedModule TryLoadModule(String filename)

 

Function TryLoadModule(filename As String) As LoadedModule

Parameters:

  • filename:

UnloadModule

 

method UnloadModule(module: LoadedModule)

 

void UnloadModule(LoadedModule module)

 

Sub UnloadModule(module As LoadedModule)

Parameters:

  • module:

 

ModuleLoaded

This event is fired when the module is loaded.

 

event ModuleLoaded: EventHandler<ModuleLoadedEventArgs>;

 

delegate 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 ModuleLoading As EventHandler<ModuleLoadingEventArgs>