64 lines
3.9 KiB
Markdown
64 lines
3.9 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- DataPRO/Modules/Realtime/RealtimeModule/RealtimeModule.cs
|
||
|
|
generated_at: "2026-04-17T16:15:36.169206+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "7c2cdf5e5e1be734"
|
||
|
|
---
|
||
|
|
|
||
|
|
# RealtimeModule
|
||
|
|
|
||
|
|
### Purpose
|
||
|
|
This module serves as the Prism module initializer for the Realtime functionality within the application. It is responsible for registering the Realtime channel selection View and ViewModel with the Unity dependency injection container and providing assembly metadata (name, image, group, region) that the shell uses to display and manage the module. The module is categorized under the "Prepare" assembly group and targets the `RealtimeModuleRegion`.
|
||
|
|
|
||
|
|
### Public Interface
|
||
|
|
|
||
|
|
**`RealtimeModule` (class)**
|
||
|
|
- Implements `Prism.Modularity.IModule`
|
||
|
|
- `RealtimeModule(IUnityContainer unityContainer)` - Constructor accepting the Unity container via dependency injection.
|
||
|
|
- `void Initialize()` - Registers `IRealtimeChannelSelectView` to `RealtimeChannelSelectView` and `IRealtimeChannelSelectViewModel` to `RealtimeChannelSelectViewModel` with the Unity container.
|
||
|
|
- `void OnInitialized(IContainerProvider containerProvider)` - Empty implementation.
|
||
|
|
- `void RegisterTypes(IContainerRegistry containerRegistry)` - Calls `Initialize()`.
|
||
|
|
|
||
|
|
**`RealtimeModuleNameAttribute` (class)**
|
||
|
|
- Extends `TextAttribute`.
|
||
|
|
- `RealtimeModuleNameAttribute()` / `RealtimeModuleNameAttribute(string s)` - Constructors that set `AssemblyName` to `AssemblyNames.RealtimeModule.ToString()`.
|
||
|
|
- `override string AssemblyName { get; }` - Returns the module name.
|
||
|
|
- `override Type GetAttributeType()` - Returns `typeof(TextAttribute)`.
|
||
|
|
- `override string GetAssemblyName()` - Returns `AssemblyName`.
|
||
|
|
|
||
|
|
**`RealtimeModuleImageAttribute` (class)**
|
||
|
|
- Extends `ImageAttribute`.
|
||
|
|
- `override BitmapImage AssemblyImage { get; }` - Retrieves image via `AssemblyInfo.GetImage(AssemblyNames.RealtimeModule.ToString())`.
|
||
|
|
- `override string AssemblyName { get; }` - Returns `AssemblyNames.RealtimeModule.ToString()`.
|
||
|
|
- `override string AssemblyGroup { get; }` - Returns `eAssemblyGroups.Prepare.ToString()`.
|
||
|
|
- `override eAssemblyRegion AssemblyRegion { get; }` - Returns `eAssemblyRegion.RealtimeModuleRegion`.
|
||
|
|
- `override Type GetAttributeType()` - Returns `typeof(ImageAttribute)`.
|
||
|
|
- `override BitmapImage GetAssemblyImage()` - Returns `AssemblyImage`.
|
||
|
|
- `override string GetAssemblyName()` - Returns `AssemblyName`.
|
||
|
|
- `override string GetAssemblyGroup()` - Returns `AssemblyGroup`.
|
||
|
|
- `override eAssemblyRegion GetAssemblyRegion()` - Returns `AssemblyRegion`.
|
||
|
|
|
||
|
|
### Invariants
|
||
|
|
- The `RealtimeModule` class must be instantiated by Prism's module manager with a non-null `IUnityContainer`.
|
||
|
|
- Assembly-level attributes `RealtimeModuleName` and `RealtimeModuleImageAttribute` are applied exactly once per assembly (`AllowMultiple = false`).
|
||
|
|
- `AssemblyName`, `AssemblyGroup`, and `AssemblyRegion` properties always return consistent values derived from `DTS.Common` enums/constants.
|
||
|
|
|
||
|
|
### Dependencies
|
||
|
|
**Depends on:**
|
||
|
|
- `DTS.Common` - Provides `AssemblyNames`, `AssemblyInfo`, `TextAttribute`, `ImageAttribute`, `eAssemblyGroups`, `eAssemblyRegion`.
|
||
|
|
- `DTS.Common.Interface` - Provides base interfaces.
|
||
|
|
- `DTS.Common.Interface.Realtime` - Provides `IRealtimeChannelSelectView`, `IRealtimeChannelSelectViewModel`.
|
||
|
|
- `Prism.Ioc`, `Prism.Modularity` - Prism framework for modular applications.
|
||
|
|
- `Unity` - Dependency injection container.
|
||
|
|
|
||
|
|
**Depended on by:**
|
||
|
|
- The application shell/bootstrapper, which discovers and loads this module.
|
||
|
|
|
||
|
|
### Gotchas
|
||
|
|
- The `Initialize()` method is called both directly and via `RegisterTypes()`, which could lead to double-registration if `RegisterTypes` is called multiple times. However, `RegisterType` in Unity typically overwrites existing registrations by default.
|
||
|
|
- The `RealtimeModuleImageAttribute` constructor parameter `string s` is accepted but never used in either constructor overload.
|
||
|
|
- `OnInitialized` is empty, so any post-initialization logic would need to be added elsewhere.
|
||
|
|
|
||
|
|
---
|