Creating a plugin from scratch isn't difficult but there is some code to type, a GUID to generate, references to Stonefield Query assemblies to add, and so on. You can have Studio generate the source code for a plugin for you. On the Calc page for fields, the Create a value converter plugin and Create a values method plugin buttons () generate the appropriate type of plugin. In the properties pane for a virtual table, the Create a virtual table plugin button generates a virtual table plugin for the selected table. The File menu has a Create Plugin function that generates the code for an application, data dictionary, data engine, or report engine plugin.

To create a plugin, click the appropriate button or choose Create Plugin from the File menu.

The Plugin type setting doesn't appear for value converter, values method, and virtual table plugins. For other types of plugins, choose the type of plugin to create.

Enter the name of the class to create; the name can only consist of letters, digits, and underscores and must start with a letter or underscore. If you enter the name of an existing class, you'll be asked if you want to overwrite it.

If you want to add the class to an existing project, turn on Add class to existing plugin project and select the desired project from the drop-down list. If there are no existing projects or if you want to create a new project, enter the name of the project. In that case, if you enter the name of an existing project, you'll be asked if you want to overwrite it.

If there's already an existing plugin solution, that name is filled in and the Solution name setting is disabled; otherwise, enter the name of the solution to create. Turn on Open solution now to open the solution in Visual Studio after it's created.

When you click OK, Studio uses the appropriate plugin template in the Plugin Templates folder to generate a CS file containing the specified class in the specified project in the specified solution in the Project_Data\Plugin Source folder (that folder is created if necessary). The generated plugin is just a starting point and doesn't do anything useful; see the // TODO comments in the class for places you'll have to add code.

When you build the DLL (or DLLs if there's more than one project in the solution), they're automatically copied to the Project_Data\Plugins folder. However, note that if Studio or Stonefield Query is open, the build will fail because the DLL is in use. Be sure to close both down in that case and then build again.

To edit the C# plugin source code Studio generated for you, click the same button you used to generate the plugin (); the solution is opened in Microsoft Visual Studio.