API Reference | Module Connection
This section of documentation describes the main interfaces required for connecting a module to the OutfitTool system.
IModuleInfo Interface
The IModuleInfo interface is a mandatory entry point for any system module. It provides the host with module metadata: its identifier, version, author, and API requirements.
Interface Definition
using OutfitTool.API1.Dto;
namespace OutfitTool.API1;
public interface IModuleInfo
{
string Name { get; }
string DisplayName { get; }
string AssemblyName { get; }
string Description { get; }
ModuleVersion Version { get; }
int RequireApiVersion { get; }
string Changes { get; }
string Author { get; }
string AuthorContacts { get; }
}
Property Descriptions
- string Name
- Internal system name of the module. Must be unique.
snake_caseis recommended. - string DisplayName
- Module name displayed in the user interface.
- string AssemblyName
- Name of the main module assembly (without
.dllextension). Must match the file name and module directory name. - string Description
- Brief description of module functionality.
- ModuleVersion Version
- Module version using semantic versioning.
- int RequireApiVersion
- Minimum API version the module is compatible with.
- string Changes
- List of changes in the current module version (changelog).
- string Author
- Name of the author or development company.
- string AuthorContacts
- Contact information for communication (email, website link, etc.).
IModuleController Interface
The IModuleController interface is the main channel for managing the module lifecycle. Through it, the host initializes the module, passes dependencies, retrieves available commands, and manages interface display.
Interface Definition
using OutfitTool.API1.Dto;
using OutfitTool.API1.Logger;
using System.Windows.Media.Imaging;
namespace OutfitTool.API1;
public interface IModuleController
{
void SetLanguage(string language);
void Init(ILogger logger);
void Shutdown();
List<ICommand> GetCommandList();
BitmapImage? GetTaskbarIcon();
string? GetTaskbarIconText();
Notification? PopNotification();
void OpenSettings();
}
Method Descriptions
- void SetLanguage(string language)
- Sets the interface language for the module. The
languageparameter is the language code (e.g., "ru-RU", "en-US"). - void Init(ILogger logger)
- Initializes the module and passes a logger instance for recording diagnostic messages.
- void Shutdown()
- Signals the module about program termination. The module must correctly release all resources.
- List<ICommand> GetCommandList()
- Returns a list of commands provided by the module. Commands are displayed in the program interface.
- BitmapImage? GetTaskbarIcon()
- Provides an icon for temporary display in the notification area. Returns
nullif no icon is required. - string? GetTaskbarIconText()
- Returns the tooltip text for the icon in the system tray. Returns
nullif no tooltip is required. - Notification? PopNotification()
- Allows the module to send a notification to the user. Returns
nullif there are no notifications. - void OpenSettings()
- Called when requesting to open the module settings window.
ICommand Interface
The ICommand interface represents a command provided by the module. Commands are displayed in the program interface (e.g., in the context menu or on the toolbar).
Interface Definition
using OutfitTool.API1.Dto;
namespace OutfitTool.API1;
public interface ICommand
{
string Name { get; }
string Description { get; }
CommandContextMenu? ContextMenu { get; }
void Run();
}
Property and Method Descriptions
- string Name
- Command name displayed in the interface.
- string Description
- Command description that may be displayed in a tooltip.
- CommandContextMenu? ContextMenu
- Additional context menu for the command. Can be
null. - void Run()
- Method called when executing the command. Contains the main command logic.