ModuleController
Overview
Module controller is an entry point of a module, module controller supply's host with information about stored plugins and provides a methods that allows host to instantiate and work with plugins.
Use Cases
Every Hydra module contains a module controller, host will create an instance of a module controller whenever module is loaded, there will be only one instance of a module controller so you can use it as a global object of your plugin module. Module controller can behave in a same way like plugin does, for example you can access host methods/properties or expose global module functionality via custom interfaces.
private void TheModuleController_HostChanged(object sender, HostChangedEventArgs e)
{
if (e.Host is IMyCustomInterface)
{
(e.Host as IMyCustomInterface).DoSomething();
}
}
Also please note the ModuleControllerAttribute, it allows you to set additional meta-data, for example:
[ModuleController(Name = "Controller", Description = "My module controller", UserData = "Data")]
public partial class TheModuleController : ModuleController
[..]
Location
- Reference: RemObjects.Hydra.dll
- Namespace: RemObjects.Hydra
- Ancestry: Component | ModuleController
constructor
Creates an instance of the object.
constructor
ModuleController()
Sub New()
CreateInstance
method CreateInstance(pluginName: String): IHYCrossPlatformPlugin
IHYCrossPlatformPlugin CreateInstance(String pluginName)
Function CreateInstance(pluginName As String) As IHYCrossPlatformPlugin
Parameters:
- pluginName:
GetLargeImages
Returns a handle of a "large images" image list.
method GetLargeImages: IntPtr
IntPtr GetLargeImages()
Function GetLargeImages() As IntPtr
GetModuleController
method GetModuleController: IHYCrossPlatformModuleController
IHYCrossPlatformModuleController GetModuleController()
Function GetModuleController() As IHYCrossPlatformModuleController
GetSmallImages
Returns a handle of a "small images" image list.
method GetSmallImages: IntPtr
IntPtr GetSmallImages()
Function GetSmallImages() As IntPtr
Host
Referense to a host interface.
property Host: IHYCrossPlatformHost read write;
IHYCrossPlatformHost Host { get; set; }
Property Host() As IHYCrossPlatformHost
HostChanged
This event is fired whenever host property is changed. Use this even to get access to a host reference.
event HostChanged: HostChangedEventHandler;
delegate: method HostChanged(sender: Object; e: HostChangedEventArgs)
delegate HostChangedEventHandler HostChanged()
delegate: void HostChanged(Object sender, HostChangedEventArgs e)
Event HostChanged As HostChangedEventHandler
delegate: Sub HostChanged(sender As Object, e As HostChangedEventArgs)
HostParameters
Currently not used.
property HostParameters: StringCollection read;
StringCollection HostParameters { get; }
ReadOnly Property HostParameters() As StringCollection
LargeImages
Image list that holds a collection of "large images".
property LargeImages: ImageList read write;
ImageList LargeImages { get; set; }
Property LargeImages() As ImageList
Plugin
property Plugin[index: Int32]: IHYCrossPlatformPluginDescriptor read;
IHYCrossPlatformPluginDescriptor Plugin[Int32 index] { get; }
ReadOnly Property Plugin(index As Int32) As IHYCrossPlatformPluginDescriptor
PluginCount
property PluginCount: Int32 read;
Int32 PluginCount { get; }
ReadOnly Property PluginCount() As Int32
SmallImages
Image list that holds a collection of "small images".
property SmallImages: ImageList read write;
ImageList SmallImages { get; set; }
Property SmallImages() As ImageList
Host
Referense to a host interface.
property Host: IHYCrossPlatformHost read write;
IHYCrossPlatformHost Host { get; set; }
Property Host() As IHYCrossPlatformHost
HostParameters
Currently not used.
property HostParameters: StringCollection read;
StringCollection HostParameters { get; }
ReadOnly Property HostParameters() As StringCollection
LargeImages
Image list that holds a collection of "large images".
property LargeImages: ImageList read write;
ImageList LargeImages { get; set; }
Property LargeImages() As ImageList
Plugin
property Plugin[index: Int32]: IHYCrossPlatformPluginDescriptor read;
IHYCrossPlatformPluginDescriptor Plugin[Int32 index] { get; }
ReadOnly Property Plugin(index As Int32) As IHYCrossPlatformPluginDescriptor
PluginCount
property PluginCount: Int32 read;
Int32 PluginCount { get; }
ReadOnly Property PluginCount() As Int32
SmallImages
Image list that holds a collection of "small images".
property SmallImages: ImageList read write;
ImageList SmallImages { get; set; }
Property SmallImages() As ImageList
constructor
Creates an instance of the object.
constructor
ModuleController()
Sub New()
CreateInstance
method CreateInstance(pluginName: String): IHYCrossPlatformPlugin
IHYCrossPlatformPlugin CreateInstance(String pluginName)
Function CreateInstance(pluginName As String) As IHYCrossPlatformPlugin
Parameters:
- pluginName:
GetLargeImages
Returns a handle of a "large images" image list.
method GetLargeImages: IntPtr
IntPtr GetLargeImages()
Function GetLargeImages() As IntPtr
GetModuleController
method GetModuleController: IHYCrossPlatformModuleController
IHYCrossPlatformModuleController GetModuleController()
Function GetModuleController() As IHYCrossPlatformModuleController
GetSmallImages
Returns a handle of a "small images" image list.
method GetSmallImages: IntPtr
IntPtr GetSmallImages()
Function GetSmallImages() As IntPtr
HostChanged
This event is fired whenever host property is changed. Use this even to get access to a host reference.
event HostChanged: HostChangedEventHandler;
delegate: method HostChanged(sender: Object; e: HostChangedEventArgs)
delegate HostChangedEventHandler HostChanged()
delegate: void HostChanged(Object sender, HostChangedEventArgs e)
Event HostChanged As HostChangedEventHandler
delegate: Sub HostChanged(sender As Object, e As HostChangedEventArgs)