Skip to content

Writing a custom module

Jan Lenoch edited this page Aug 28, 2018 · 8 revisions

Creating a new KInspector module requires two basic things:

  1. Creating a class implementing the KInspector.Core.IModule interface.
  2. Placing this class within the KInspector.Modules project

All implementations of IModule interface are automatically discovered at runtime and displayed in the UI.

IModule interface implementation

The interface contains two methods:

  • GetModuleMetadata - returns ModuleMetadata object that consists of module name, its description and list of supported Kentico versions
  • GetResults - returns ModuleResults object with actual results (can be e.g. a DataTable) and a status code. As an example, take a look at the implementation of the Application restarts module.

You should always provide users with sufficient and relevant information on what the module does and how to interpret the results (either by including your own description or via external links). Put these information to ModuleMetadata.Comment property.

Module files

When developing new modules within the KInspector.Modules project, follow the following file structure:

  • SQL Script
    • .\Scripts folder or subfolder
    • In the file's properties, don't forget to set Copy to Output Directory to Copy Always
  • C# module code
    • .\Modules folder or subfolder
  • Probe file
    • .\ProbeData folder or subfolder
    • In the file's properties, don't forget to set Copy to Output Directory to Copy Always and set the Build Action to Content.

Analytics

Clone this wiki locally