--- source_files: - DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.AddCalculatedChannel/AddCalculatedChannelModule.cs generated_at: "2026-04-17T16:45:39.586862+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "bf1eaf68424d2d4f" --- # Documentation: AddCalculatedChannelModule ## 1. Purpose This module is a Prism-based plugin for the DTS Viewer application that provides functionality to add calculated channels. It follows the module pattern to register its View and ViewModel with the Unity dependency injection container, and exposes assembly metadata (name, image, group, region) via custom attributes for display in the main application's component list. The module is designed to be dynamically loaded and integrated into the larger DTS Viewer modular architecture. --- ## 2. Public Interface ### `AddCalculatedChannelModule` The main module class implementing `Prism.Modularity.IModule`. **Constructor:** ```csharp public AddCalculatedChannelModule(IUnityContainer unityContainer) ``` Accepts a Unity container instance via dependency injection and stores it in a private readonly field `_unityContainer`. **Methods:** ```csharp public void Initialize() ``` Registers the View and ViewModel interfaces with their concrete implementations in the Unity container: - `IAddCalculatedChannelView` → `AddCalculatedChannelView` - `IAddCalculatedChannelViewModel` → `AddCalculatedChannelViewModel` ```csharp public void OnInitialized(IContainerProvider containerProvider) ``` Empty implementation — no initialization logic executed when the module is loaded. ```csharp public void RegisterTypes(IContainerRegistry containerRegistry) ``` Calls `Initialize()` to perform type registrations. --- ### `AddCalculatedChannelModuleNameAttribute` Assembly-level attribute extending `TextAttribute` that provides the module's display name. **Constructor:** ```csharp public AddCalculatedChannelModuleNameAttribute() public AddCalculatedChannelModuleNameAttribute(string s) ``` The string parameter `s` is accepted but not used.