ModuleManager Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for Hydra for .NET
This page is generated from external data, please do not update

NamespacesInterfacesClassesEnumsImplements

Contents

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

  • Assembly: RemObjects.Hydra.Host.dll
  • Namespace: RemObjects.Hydra
  • Ancestry: System.ComponentModel.Component | ModuleManager


Properties

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.



Prism:   property Host: IHYCrossPlatformHost read write
C#:   IHYCrossPlatformHost Host { get; set; }
VB:   Property Host As IHYCrossPlatformHost


Modules

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



Prism:   property Modules: ICollection read
C#:   ICollection Modules { get; }
VB:   Property ReadOnly Modules As ICollection


Plugins

List of all plugin descriptors contained in plugin modules.



Prism:   property Plugins: PluginList read
C#:   PluginList Plugins { get; }
VB:   Property ReadOnly Plugins As PluginList


Instance Methods

constructor

Creates an instance of the class.


Oxygene:   constructor
C#:   constructor()
VB:   Sub New


CreateInstance (PluginDescriptor): IHYCrossPlatformPlugin

Creates an instance of a plugin with given descriptor.


Oxygene:   method CreateInstance(aPluginDescriptor: PluginDescriptor): IHYCrossPlatformPlugin
C#:   IHYCrossPlatformPlugin CreateInstance(PluginDescriptor aPluginDescriptor)
VB:   Function CreateInstance(aPluginDescriptor As PluginDescriptor) As IHYCrossPlatformPlugin


Parameters:

  • aPluginDescriptor: Reference to a plugin descriptor


CreateInstance (String): IHYCrossPlatformPlugin

Creates an instance of a plugin with given name.


Oxygene:   method CreateInstance(aName: String): IHYCrossPlatformPlugin
C#:   IHYCrossPlatformPlugin CreateInstance(String aName)
VB:   Function CreateInstance(aName As String) As IHYCrossPlatformPlugin


Parameters:

  • aName: Name of the plugin.


LoadFiremonkeyModule

Loads a FireMonkey plugin module.


Oxygene:   method LoadFiremonkeyModule(FileName: String): LoadedFiremonkeyModule
C#:   LoadedFiremonkeyModule LoadFiremonkeyModule(String FileName)
VB:   Function LoadFiremonkeyModule(FileName As String) As LoadedFiremonkeyModule


Parameters:

  • FileName: Path to a plugin module.


LoadManagedModule (array of Byte): LoadedManagedModule

Loads managed plugin module from the array. Deprecated only for backward compatibility.


Oxygene:   method LoadManagedModule(aAssembly: array of Byte): LoadedManagedModule
C#:   LoadedManagedModule LoadManagedModule(array of Byte aAssembly)
VB:   Function LoadManagedModule(aAssembly As array of 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.


Oxygene:   method LoadManagedModule(aAssembly: Assembly): LoadedManagedModule
C#:   LoadedManagedModule LoadManagedModule(Assembly aAssembly)
VB:   Function LoadManagedModule(aAssembly As Assembly) As LoadedManagedModule


Parameters:

  • aAssembly: Reference to a pre-loaded assembly.


LoadManagedModule (String): LoadedManagedModule

Loads managed plugin module with given file name.


Oxygene:   method LoadManagedModule(aFilename: String): LoadedManagedModule
C#:   LoadedManagedModule LoadManagedModule(String aFilename)
VB:   Function LoadManagedModule(aFilename As String) As LoadedManagedModule


Parameters:

  • aFilename: Path to a plugin module.


LoadManagedModule (String, Boolean): LoadedManagedModule

Loads managed plugin module with given file name.


Oxygene:   method LoadManagedModule(aFilename: String; aInNewAppDomain: Boolean): LoadedManagedModule
C#:   LoadedManagedModule LoadManagedModule(String aFilename, Boolean aInNewAppDomain)
VB:   Function LoadManagedModule(aFilename As String, aInNewAppDomain As Boolean) As LoadedManagedModule


Parameters:

  • aFilename: Path to a plugin module.
  • aInNewAppDomain: Control whether plugin module will be loaded into a new AppDomain.


LoadModule (String): LoadedModule

Loads a plugin module with given file name. This method will automatically detect plugin type and use one of the specific methods.


Oxygene:   method LoadModule(aFilename: String): LoadedModule
C#:   LoadedModule LoadModule(String aFilename)
VB:   Function LoadModule(aFilename As String) As LoadedModule


Parameters:

  • aFilename: Path to a plugin module.


LoadModule (String, Boolean): LoadedModule

Loads a plugin module with given file name. This method will automatically detect plugin type and use one of the specific methods.


Oxygene:   method LoadModule(aFilename: String; aInNewAppDomain: Boolean): LoadedModule
C#:   LoadedModule LoadModule(String aFilename, Boolean aInNewAppDomain)
VB:   Function LoadModule(aFilename As String, aInNewAppDomain As Boolean) As LoadedModule


Parameters:

  • aFilename: Path to a plugin module.
  • aInNewAppDomain: Control whether plugin module will be loaded into a new AppDomain (only for managed plugins).


LoadSilverlightModule

Loads Silverlight plugin module with given file name.


Oxygene:   method LoadSilverlightModule(aFileName: String): LoadedSilverlightModule
C#:   LoadedSilverlightModule LoadSilverlightModule(String aFileName)
VB:   Function LoadSilverlightModule(aFileName As String) As LoadedSilverlightModule


Parameters:

  • aFileName: Path to a plugin module.


LoadUnmanagedModule

Loads unmanaged plugin module with given file name.


Oxygene:   method LoadUnmanagedModule(aFilename: String): LoadedUnmanagedModule
C#:   LoadedUnmanagedModule LoadUnmanagedModule(String aFilename)
VB:   Function LoadUnmanagedModule(aFilename As String) As LoadedUnmanagedModule


Parameters:

  • aFilename: Path to a plugin module.


TryLoadModule

Tries to load a module from the specified file and returns a reference to the loaded module or null if loading fails.


Oxygene:   method TryLoadModule(aFilename: String): LoadedModule
C#:   LoadedModule TryLoadModule(String aFilename)
VB:   Function TryLoadModule(aFilename As String) As LoadedModule


Parameters:

  • aFilename: Path to a plugin module.


UnloadModule

Unloads specified plugin module. Please note that managed plugins can be fully unloaded only when they was loaded into separate AppDomain.


Oxygene:   method UnloadModule(aModule: LoadedModule)
C#:   void UnloadModule(LoadedModule aModule)
VB:   Sub UnloadModule(aModule As LoadedModule)


Parameters:

  • aModule: Reference to a module.


Events

ModuleLoaded

This event is fired when the module is loaded.



Oxygene:   event ModuleLoaded: ModuleLoadedEvent
delegate: method Invoke(sender: Object; e: ModuleLoadedEventArgs)

C#:   event ModuleLoadedEvent ModuleLoaded
delegate: void Invoke(Object sender, ModuleLoadedEventArgs e)

VB:   Event ModuleLoaded As ModuleLoadedEvent
delegate: Sub Invoke(sender As Object, e As ModuleLoadedEventArgs)


ModuleLoading

This event is fired before loading the module.



Oxygene:   event ModuleLoading: ModuleLoadingEvent
delegate: method Invoke(sender: Object; e: ModuleLoadingEventArgs)

C#:   event ModuleLoadingEvent ModuleLoading
delegate: void Invoke(Object sender, ModuleLoadingEventArgs e)

VB:   Event ModuleLoading As ModuleLoadingEvent
delegate: Sub Invoke(sender As Object, e As ModuleLoadingEventArgs)


See Also


Product: RemObjects Hydra
Current version: Hydra 4.0

GlossaryArchitectureArticlesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox