Writing A Plug in - Gadroc/helios GitHub Wiki

This page refers to an unreleased version of Helios. 1.5 source tree will be migrated to this, but it is not for current versions.

Overview

Helios uses the Managed Extensibility Framework(MEF) to support plug-in development. This allows additional capabilities to be added with out have to rebuild / redeploy the entire application. Your plug-in can expose three types of capabilities to Helios.

  1. Displays - Displays can be used to display controls that are part of a profile.
  2. Devices - Devices can be used to expose hardware and software to the Helios environment. These will commonly be used to expose IO Systems like EOS or simulations like DCS A-10C Warthog.
  3. Controls - These are interactive controls which can be displayed on screen. Controls can be used to display simulation state information (Ex: Altitude) or allow input (Ex: Jettison Stores Button). Often times a control will do both.

Creating A New Project

New Helios plug-in projects should be created as a Visual C# Class Library. They should target ".NET Framework 4.5".

They must have the following references in place. (Note they can have more as necessary but these are the bare minimum.) The Helios reference can be added by browsing to the Helios installation directory. It is in the Helios.dll file.

  1. Microsoft.CSharp
  2. System
  3. System.ComponentModel.Composition
  4. System.Core
  5. Helios

Create Your Plug-in Class(es)

Your assembly can contain one or more plug-ins. For each plug-in you will create a Plugin class which implements the IPlugIn interface. You will then need to decorate that class so MEF will find it and import it into the Helios runtime.

    [Export(typeof(IPlugIn))]
    [ExportMetadata("Id", "GadrocsWorkshop.MyPlugin")]
    [ExportMetadata("Name", "Example Plug-in")]
    [ExportMetadata("Description", "Example Plug-in description.")]
    public class MyPlugin : IPlugIn
    {
    }

Deploy Plug-in

Plugins should be deployed along with any dependancies into the PlugIns subdirectory of the Helios install. This is the only directory which is searched for plugins.