A .NET UI plugin component relies on a particular format of an xml manifest file for registration.
Compiled components are contained in a dynamic link library, whose filename has an extension 'dll'. To register a .NET UI plugin component, create a command window (under the Start menu, hit "Run ...", type 'Command' and hit OK). Change your directory (using cd) to that of the file. At the command prompt, type 'regasm /codebase YOUR_UIPLUGINNAME'. For example:
regasm /codebase YOUR_UIPLUGINNAME.dll
Note: Your system may not recognize the regasm command. In that case, you will need to specify the full filepath to RegAsm.exe. The file itself is found in a sub-folder of C:\WINDOWS\Microsoft.NET\Framework\. The actual folder depends on your version of the .NET Framework installed on your machine.
ODTK uses an XML manifest file to discover and load plugins at run-time. Using either Visual Studio or a text editor, create a new XML file. AGI recommends naming the XML file with the same name as your plugin (MySampleUiPlugin.xml). Below are examples of the required format for .NET UI plugins.
<?xml version = "1.0"?> <AGIRegistry version = "1.0"> <CategoryRegistry> <Category Name = "UiPlugins"> <NETUiPlugin DisplayName="Rectangular Sensor UI Plugin (Examples)" TypeName="RectangularSensorPlugin.RectangularSensorPlugin" AssemblyName="RectangularSensorPlugin, Version=126.96.36.199, Culture=neutral, PublicKeyToken=null" CodeBase="C:\ProgramData\DeveloperKit\CodeSamples\Extend\Ui.Plugins\CSharp\RectangularSensorPlugin\RectangularSensorPlugin\bin\Debug"> </NETUiPlugin> </Category> </CategoryRegistry> </AGIRegistry>
This XML file must be saved in one of these three locations, where ODTK will see it:
ODTK User Config Plugins directory (usually My Documents\ODTK 6\Config\Plugins)
Plugins registered here will be available only to the single user with access to this My Documents folder. Usually does not require administrative privileges.
All Users Application folder (C:\ProgramData\AGI\ODTK 6\Plugins on Windows 7 and Vista, or C:\Documents and Settings\All Users\Application Data\AGI\ODTK 6\Plugins on Windows XP)
Plugins registered here will be available to all STK users on this machine. Usually does not require administrative privileges.
ODTK install directory (usually C:\Program Files (x86)\AGI\ODTK 6\Plugins)
Plugins registered here will be available to all ODTK users on this machine. Usually requires administrative privileges to save/modify files here.
When the host application starts, it searches for xml files contained in identified folders and registers all plugins declared in each xml file found. Any changes made to these files after start-up will not take effect until the next time the application starts. ODTK looks at the following folders for xml plugin registration files:
XML registration files located in <ODTK installation folder>\ODTK 6\Plugins and <Windows All Users Application area>\AGI\ODTK 6\Plugins are available for every user; those located in <Windows Configuration area>\Plugins will be available only for that user.