Using the Custom Action Project Template

Prerequisite:

Custom actions can be created to execute custom data processing on tracking data. An action can belong to one or more of the following categories: server actions, service actions, layer actions, and real-time layer actions.

The C# Custom Action Project Template can be used to create a custom action of any of these types.

Steps:
  1. Start Visual Studio and create a new project. The New Project dialog box appears.
  2. In the Project types listing, select Visual C# > ArcGIS > Engine.

    If you have installed the Tracking Server SDK, then the ArcGIS heading appears in the Visual C# section of the Project types listing, and the available C# templates are under this heading.

  3. Select TrackingCustomAction from the list of installed templates.
  4. Enter additional information required for your new project and click OK to create the project. For example, you might want to change the name and location of your project.
  5. If you have ArcGIS for Desktop installed, you can uncomment several areas of the project code to expose functionality that is only available with ArcGIS for Desktop. To find these areas, serach for the phrase "TODO" throughout the entire project and follow the instructions.

    If you have ArcGIS Engine for Windows installed, do not uncomment these areas of code.

  6. Based on the type of action you want to create, uncomment the appropriate lines of code from both the ArcGISCategoryRegistration and ArcGISCategoryUnregistration functions in the "CustomAction.cs" file. A single action may be registered under multiple categories.

    The available action categories are:

    • Server Action
    • Service Action
    • Real-time Layer Action
    • Layer Action
  7. Add custom code to the classes in the project to achieve the desired result. To find the areas where it is suggested to modify the code, search for the phrase "TODO" throughout the entire project and follow the instructions.
  8. Build the project.
  9. Your custom action is ready for use.

    If you have ArcGIS for Desktop installed, then layer actions, real-time layer actions, and service actions will be available in the appropriate layer or service properties dialog boxes. If you have Tracking Server installed, then server actions will appear in Tracking Server Manager.

8/21/2012