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

Implements

 

constructor

Creates an instance of the object.

 

constructor

 

ModuleController()

 

Sub New

add_HostChanged

 

method add_HostChanged(value: HostChangedEventHandler)

 

void add_HostChanged(HostChangedEventHandler value)

 

Sub add_HostChanged(value As HostChangedEventHandler)

Parameters:

  • value:

GetLargeImages

Returns a handle of a "large images" image list.

 

method GetLargeImages: IntPtr

 

IntPtr GetLargeImages()

 

Function GetLargeImages As IntPtr

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

 

Property ReadOnly 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

remove_HostChanged

 

method remove_HostChanged(value: HostChangedEventHandler)

 

void remove_HostChanged(HostChangedEventHandler value)

 

Sub remove_HostChanged(value As HostChangedEventHandler)

Parameters:

  • value:

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

 

Property ReadOnly 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

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

add_HostChanged

 

method add_HostChanged(value: HostChangedEventHandler)

 

void add_HostChanged(HostChangedEventHandler value)

 

Sub add_HostChanged(value As HostChangedEventHandler)

Parameters:

  • value:

GetLargeImages

Returns a handle of a "large images" image list.

 

method GetLargeImages: IntPtr

 

IntPtr GetLargeImages()

 

Function GetLargeImages As IntPtr

GetSmallImages

Returns a handle of a "small images" image list.

 

method GetSmallImages: IntPtr

 

IntPtr GetSmallImages()

 

Function GetSmallImages As IntPtr

remove_HostChanged

 

method remove_HostChanged(value: HostChangedEventHandler)

 

void remove_HostChanged(HostChangedEventHandler value)

 

Sub remove_HostChanged(value As HostChangedEventHandler)

Parameters:

  • value:

 

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)