Skip to main content

Plugin development

HH Timing V2 uses the .NET Framework, therefore plugins can be created using any .NET Framework language (C# or VB.NET for example).

The user interface of HH Timing V2 is built using WPF (in contrast to HH Timing 0.9 that is built using WinForms) and so any user interface elements in a plugin must also be developed using WPF.

tip

An example HH Timing V2 plugin has been provided on GitHub. This can be used instead of starting a plugin from scratch.

danger

As HH Timing V2 is still under development we may introduce breaking changes in plugins between releases.

Prerequisites​

To create a plugin, the following programs must be installed:

  • The latest version of HH Timing V2
  • The latest version of Visual Studio 2026

Setting up the project​

Create a new Visual Studio project. Ensure that it targets .NET 9.0 (please note this is not necessarily the default setting depending on which version of Visual Studio is being used). It is okay to target a .NET version below 9.0, but the plugin will not load correctly if it targets a version above 9.0.

References​

Add references to the following HH Data Management DLLs to the project:

  • HHDev.Core.dll
  • HHDev.Core.NETStandard.dll
  • HHDev.Core.WPF.dll
  • HHTiming.Core.Definitions.dll
  • HHTiming.Core.CS.dll
  • HHDev.Timing.Client.Wpf.dll

These files are located in the installation directory of the software which by default is C:\Program Files\HH Development\HH Timing V2.

Ensure that the CopyLocal flag is set to false for these references.

PluginInfo.json​

A json file called PluginInfo.json with information about the plugin must be placed in the root directory of the plugin. This is read by HH Timing V2 as part of the loading process.

An example of the file contents follows:

{
"EntryDll": "HHDev.Timing.DemoPlugin.dll",
"TargetVersionNumber": "26.99"
}
  • EntryDll: the name of the file that contains the IHHTimingPlugin implementation (i.e. the main assembly of the plugin)

  • TargetVersionNumber: the version of HH Timing V2 the plugin is built to support. Currently supported versions are:

    • "26.99"

    This list will be updated as new versions of HH Timing V2 are released. Versions will be removed when HH Timing V2 is updated with breaking changes. When this happens, the plugin must be updated to support these changes and the TargetVersionNumber must be updated in order for the plugin to continue to be loaded by HH Timing V2.

Plugin Interfaces​

IHHTimingPlugin​

In the HHDev.Timing.Client.Wpf.PluginFramework.Interfaces namespace the interface IHHTimingPlugin interface is defined. A class that implements the IHHTimingPlugin interface is the entry point for a plugin to be used in HH Timing V2. A plugin must contain exactly one class that implements this interface for it to be loaded into the software.

The IHHTimingPlugin interface has four members:

  • Name: this is the name of the plugin that will be shown in the software
  • AutoUpdateKey: this is a short string that is used to identify a plugin (this isn't used right now as there is no auto update for plugins, but will be important in the future)
  • PluginId: a unique ID for the plugin - it should be a randomly generated Guid, and unique for all plugins

Once the basics of the IHHTimingPlugin have been implemented in a class, further interfaces can be implemented by the class to access the various customizations permitted by the plugin framework.

ICustomizeUserInterfacePlugin​

  • Allows custom ribbon bar tabs to be defined that are added to the ribbon bar of the main window of the software
  • Allows for custom views and view models to be registered, created and used within the software
  • Allows for assemblies where icons may be located to be defined so they can be searched when the software is trying to locate an icon by name

Key concepts​

MVVM​

HH Timing V2 uses the MVVM pattern for the user interface layer. If custom views are to be created in a plugin they should follow the MVVM pattern to ensure they fit with the concepts of the software. MVVM stands for Model-View-ViewModel. In HH Timing V2, the model is generally the UICacheContainer that contains all of the required associated objects (e.g. UICacheCar, UICacheLap, etc.). In WPF, the view is normally defined in XAML and defines the user interface of the view. All views should be derived from HHDev.Core.WPF.Views. The view model exists between the view and the model and is responsible for providing the model to the view in a way that can be used for data binding and for responding to any inputs from the view to update the model, all view models should inherit from BaseViewModel. As can be seen in the demo plugin, we normally introduce an additional layer, the "Control" that has some reusable logic that we didn't want to put in the ViewModels. Therefore it is recommended to use a control derived from BaseUICacheReferencingControl for all of the main logic for custom controls.

UICache​

The current session is normally presented to plugins as a UICacheContainer which has a list of all items in the session (cars, drivers, stints, laps, sectors, etc.). The UICache is updated internally by the HH Timing V2 code based on the incoming timing feed.

Demo plugin​

Demo scoreboard​

The DemoScoreboard shows how a simple, single table scoreboard can be created in the plugin. It consists of the following classes:

  • DemoScoreboardView - for a scoreboard this should inherit from BaseScoreboardView

Demo car status control​