Files
DP44/docs/ai/DataPRO/Modules/SystemSettings/TestSettings.md
2026-04-17 14:55:32 -04:00

51 lines
3.1 KiB
Markdown

---
source_files:
- DataPRO/Modules/SystemSettings/TestSettings/TestSettingsModule.cs
generated_at: "2026-04-17T16:46:56.534471+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ff6ed05b80cd7e58"
---
# Documentation: TestSettingsModule
## 1. Purpose
This module serves as a Prism-based plugin for the "TestSettings" functionality within a modular WPF application. It is responsible for registering the Test Settings view and view model with the Unity dependency injection container, enabling the main application to discover and display this module's UI. The module also provides assembly metadata (image, name, group) via a custom attribute for display on the main screen's component list.
---
## 2. Public Interface
### `TestSettingsModule` (Class)
Implements `Prism.Modularity.IModule`. The primary entry point for the module.
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `TestSettingsModule(IUnityContainer unityContainer)` | Accepts a Unity container via constructor injection. |
| `RegisterTypes` | `void RegisterTypes(IContainerRegistry containerRegistry)` | Registers `ITestSettingsView``TestSettingsView` and `ITestSettingsViewModel``TestSettingsViewModel` with Unity. Internally calls `Initialize()`. |
| `OnInitialized` | `void OnInitialized(IContainerProvider containerProvider)` | Empty implementation; no initialization logic executed. |
| `Initialize` | `void Initialize()` | Performs the actual type registrations with `_unityContainer`. |
### `TestSettingsImageAttribute` (Class)
Extends `ImageAttribute`. Provides metadata about the assembly for UI display purposes.
| Member | Signature | Description |
|--------|-----------|-------------|
| `AssemblyRegion` | `override eAssemblyRegion AssemblyRegion` | **Throws `NotImplementedException`** when accessed. |
| `AssemblyImage` | `override BitmapImage AssemblyImage { get; }` | Loads and returns the assembly image via `AssemblyInfo.GetImage(AssemblyNames.TestSettings.ToString())`. |
| `AssemblyName` | `override string AssemblyName { get; }` | Returns `AssemblyNames.TestSettings.ToString()`. |
| `AssemblyGroup` | `override string AssemblyGroup { get; }` | Returns `eAssemblyGroups.Administrative.ToString()`. |
| `GetAttributeType` | `override Type GetAttributeType()` | Returns `typeof(ImageAttribute)`. |
| `GetAssemblyImage` | `override BitmapImage GetAssemblyImage()` | Returns `AssemblyImage`. |
| `GetAssemblyName` | `override string GetAssemblyName()` | Returns `AssemblyName`. |
| `GetAssemblyGroup` | `override string GetAssemblyGroup()` | Returns `AssemblyGroup`. |
| `GetAssemblyRegion` | `override eAssemblyRegion GetAssemblyRegion()` | **Throws `NotImplementedException`**. |
---
## 3. Invariants
- **Container Dependency**: `_unityContainer` is injected via constructor and is expected to be non-null; no null-check is performed.
- **Type Registration**: `ITestSettingsView` must resolve to `TestSettingsView`, and `ITestSettingsViewModel` must resolve to `TestSettingsViewModel`. These types are not defined in this file but are expected to exist elsewhere in the assembly.
- **Assembly Metadata**: `AssemblyName`