Manual
Table Of Contents
- Table of Contents
- Preface
- 1 Introduction
- 2 Creating and Redistributing LNS Device Plug ins
- 3 How Plug ins Work with Directors
- How Plug ins Are Represented in the LNS Object Server
- How Plug ins are Installed and Made Visible to LNS
- How Plug ins Implement the Registration Command
- How Plug ins Respond to Commands from a Director Other than Registration
- How Directors Launch and Manipulate Plug ins
- What Plug ins Do When They Run in Standalone Mode
- Responding to Property Reads and Writes
- Uninstallation Issues
- Appendix A Standard Plug in Commands
- Appendix B Standard Plug in Properties
- Appendix C Standard Plug in Object Classes
- Appendix D Standard Plug in Exceptions
Field Description
ObjectName The fully specified name of the LNS object on which to
perform the command, as specified by the director.
LcaObject A reference to the LNS object on which to perform the
command, as decoded by the LNS Plug-in Framework (or null
if unable to decode).
Note: The Actions array will contain only one item unless the plug-in MultiObject feature is
specified as Supported. You can also obtain a reference to the LNS Object Server through the
framework’s LcaClass.Instance method, or to the currently open Network and System objects
through the LcaClass.Network and LcaClass.System properties, respectively.
The following code demonstrates how your plug-in form class should appear (note that MyPlugin
represents the name of your plug-in):
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Echelon.LNS.Plugin;
using Echelon.LNS.Interop;
namespace YourCompany.DevicePlugin
{
public partial class MyPluginForm : PluginFormBase
{
public MyPluginForm()
{
InitializeComponent();
}
protected override void ActivatePlugin()
{
// carry out each queued command action
foreach (PluginAction action in Plugin.Actions)
{
// extract information from command action
EnumCommandIds commandId = action.CommandId;
EnumClassIds classId = action.ComponentClassId;
string objectName = action.ObjectName;
object lcaObject = action.LcaObject;
// perform the command action
switch (commandId)
{
case EnumCommandIds.Test:
// TODO: add command handler here
break;
// TODO: add other command handlers here
}
}
}
}
}
Note: Typically, a device plug-in is launched from the director, and it then allows the user to select
various device configuration options from a user interface that is customized to the device
functionality. After creating your basic PluginForm class, you can add most of your plug-in
functionality to this user interface class, adding controls using Visual Studio’s Form Designer and
updating your controls from your command handlers.