How To Use The Visual Studio Add In To Automatically Create The Code Framework Of An Appliance

<< Back to the Shared Phidgets 3 page


  • Introduction
  • Create a new appliance project
  • Using the Visual Studio IDE Add-In


The Shared Phidgets Add-In for the Visual Studio IDE can support developers when prototyping new appliances. The Add-In allows the exploration of the Shared Phidgets infrastructure from within the IDE, and can create a basic class framework of all needed hardware proxy objects. Furthermore, the Add-In can automatically create event handling methods, interface skins, as well as shared dictionary subscriptions to the current development project.

Create a new appliance project

First, create a new Shared Phidgets appliance, e.g., by using the template described here.

Alternatively, you can create a new Windows forms project, and change the main class to derive from GroupLab.SharedPhidgets.Appliance.Appliance.

Using the Visual Studio IDE Add-In

Start the add-in from the Visual Studio Tools menu:

The Add-In will be started, and you can connect to the running instance of a Shared Phidgets Connector:

In the main window of the Add-In, a list of all currently available devices is listed (1). Once one of the hardware devices is selected, detailed information about this device is shown (2). If the developer wishes to add this component to the development project, he/she can choose if an interface skins should be added to the project (3). Furthermore, the developer can select all needed event handlers that should be added to the project (4). Finally, the "Add Component" button adds this device to the solution.

Now, the previous step can be repeated for all required hardware devices. The selected devices appear in the list box on the bottom of the Add-In window. To finally create the class framework for these hardware devices, choose the "Create Code Framework..." button:

The Add-In then adds all selected hardware devices to the current project (2). The interface skins of the devices are added to the main form of the project (1). The properties of all added components can be changed with the property designer (3).

Developers can also decide to add further event handlers. In the following figure we see that the Add-In has already created an event handler for the Tag event of the RFID reader:

This also includes the event handler code, that is already added to the source code of the appliance form:

Finally, developers can now start from here to add the custom code to the form, to implement the appliance logic.