What are the options for interfacing one's own code to your stuff? For example, if a user wrote some routines that were contained in a .NET dll (VB.NET or C#), can you set a reference to the dll and call the routines (including passing parameters) as you would from a normal .NET Windows program? And can the features of your program be accessed from the users code?
Yes you can. And if you are a .net developer this can be a very easy task.
You would do this by creating a new device driver which is a fairly simple process and there are some examples included with the installation. If you just wanted to call some routines then you would just add them to a simple device driver and likely wouldn't take advantage of the other device driver possibilities.
Technically speaking, you create a device driver by inheriting from the provided Driver class, add a [DriverAttribute] which includes your name, the driver version, etc, and then compiling your assembly to a dll. That in itself would be a device driver that doesn't do anything. j9ae automatically scans all dlls in it's directory for these classes and shows them in the available device drivers list. If you already had your method written, it would take about 5 minutes to create a new driver class, add your routine, compile it and place it in the appropriate directory.
Of course that would be a very simple device driver but you can do a lot more than that, such as adding configuration settings to your device driver, adding events, properties, action list grammer, etc.
You can view the Device Driver SDK documentation
here. Also if you are interested in a free software license then you may want to take a look at the
Device Driver Development Incentive Program.
In fact, just to show you how simple a device driver is, here's an simple driver that just provides a HelloWorld method that would be accessible via the action list using English grammar or from a script.
Code:
[Driver(
"Simple Driver Example", // Display Name
"This is an empty/shell driver for example purposes only.", // Description
"Joe Smith", // Author
"Example", // Category
"", // Subcategory
"example", // Default instance name
DriverMultipleInstances.MultiplePerDriverService, // Allow multiple instances
0, // Major Version
1, // Minor Version
DriverReleaseStages.Development, // Release Stage
"", // Manufacturer Name
"", // Manufacturer Url
null // Registration - future use
)]
public class SimpleDriver : SharedLibrary.DriverSupport.Driver
{
[ScriptObjectMethod("Hello World", "Just a simple example method.", "Return a Hello World string followed by the name {PARAM|0|Johnny}.")]
[ScriptObjectMethodParameter("Name", "The name to show after Hello World.")]
public ScriptString HelloWorld(ScriptString name)
{
return new ScriptString("Hello World - " + name);
}
}
Sorry, I know that's off topic but this is the kind of thing that gets me excited.
Note: It has been brought to my attention that a couple of the example drivers included in the installation don't compile. Some recent API changes broke them, however they can be edited to work with a couple minor changes. I have corrected this and will have a minor release in a week or so. If you are interested, the changes are available immediately upon request.