6.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:07:19.006418+00:00 | zai-org/GLM-5-FP8 | 1 | a6eff6c72a8470eb |
Documentation: AddCalculatedChannelModule
1. Purpose
This module provides the "Add Calculated Channel" functionality for the DTS Viewer application. It is a Prism module responsible for registering its associated View (AddCalculatedChannelView) and ViewModel (AddCalculatedChannelViewModel) with the Unity dependency injection container. The module also defines assembly-level metadata attributes that expose the module's name, image, group, and region for use by the main application shell.
2. Public Interface
AddCalculatedChannelModule (Class)
Implements Prism.Modularity.IModule. The primary module entry point.
| Member | Signature | Description |
|---|---|---|
| Constructor | AddCalculatedChannelModule(IUnityContainer unityContainer) |
Accepts an injected IUnityContainer instance and stores it in _unityContainer. |
RegisterTypes |
void RegisterTypes(IContainerRegistry containerRegistry) |
Calls Initialize(). Required by IModule. |
OnInitialized |
void OnInitialized(IContainerProvider containerProvider) |
Empty implementation. Required by IModule. |
Initialize |
void Initialize() |
Registers IAddCalculatedChannelView → AddCalculatedChannelView and IAddCalculatedChannelViewModel → AddCalculatedChannelViewModel with Unity. |
AddCalculatedChannelModuleNameAttribute (Class)
Extends TextAttribute. Applied at assembly level to expose the module name.
| Member | Signature | Description |
|---|---|---|
| Constructor | AddCalculatedChannelModuleNameAttribute() |
Default constructor. |
| Constructor | AddCalculatedChannelModuleNameAttribute(string s) |
Overload accepting a string (parameter is unused). |
AssemblyName |
override string AssemblyName { get; } |
Returns AssemblyNames.AddCalculatedChannel.ToString(). |
GetAttributeType |
override Type GetAttributeType() |
Returns typeof(TextAttribute). |
GetAssemblyName |
override string GetAssemblyName() |
Returns AssemblyName. |
AddCalculatedChannelModuleImageAttribute (Class)
Extends ImageAttribute. Applied at assembly level to expose module image, name, group, and region metadata.
| Member | Signature | Description |
|---|---|---|
| Constructor | AddCalculatedChannelModuleImageAttribute() |
Default constructor. |
| Constructor | AddCalculatedChannelModuleImageAttribute(string s) |
Overload accepting a string (parameter is unused). |
AssemblyImage |
override BitmapImage AssemblyImage { get; } |
Lazily loads image via AssemblyInfo.GetImage(). |
AssemblyName |
override string AssemblyName { get; } |
Returns AssemblyNames.AddCalculatedChannel.ToString(). |
AssemblyGroup |
override string AssemblyGroup { get; } |
Returns eAssemblyGroups.Viewer.ToString(). |
AssemblyRegion |
override eAssemblyRegion AssemblyRegion { get; } |
Returns eAssemblyRegion.AddCalculatedChannelRegion. |
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() |
Returns AssemblyRegion. |
3. Invariants
- Module Name: The Prism module name is the string literal
"AddCalculatedChannel"(set via[Module(ModuleName = "AddCalculatedChannel")]). - Single Instance Attributes: Both assembly attributes are declared with
AllowMultiple = false, ensuring only one of each exists per assembly. - Region Assignment: The module is always associated with
eAssemblyRegion.AddCalculatedChannelRegion. - Group Assignment: The module always belongs to
eAssemblyGroups.Viewer. - Interface Registration: Types are registered by interface (
IAddCalculatedChannelView,IAddCalculatedChannelViewModel) rather than concrete types.
4. Dependencies
This module depends on:
System- Core .NET framework.System.Windows.Media.Imaging- ForBitmapImageused in module image.DTS.Common- ProvidesAssemblyNamesenum andeAssemblyGroups,eAssemblyRegionenums.DTS.Common.Interface- ProvidesTextAttribute,ImageAttribute, andAssemblyInfobase classes/utilities.Prism.Ioc- ForIContainerProviderandIContainerRegistry.Prism.Modularity- ForIModuleinterface andModuleAttribute.Unity- ForIUnityContainerDI container.
What depends on this module:
- Inferred: The main DTS Viewer shell application, which discovers and loads Prism modules via assembly attributes and registers Views/ViewModels for navigation.
- Inferred:
IAddCalculatedChannelViewandIAddCalculatedChannelViewModelconsumers (likely defined inDTS.Common.Interfaceor elsewhere).
5. Gotchas
-
Misleading Singleton Comment: The comment on line 42 states "Register View & View-Model with Unity dependency injection container as a singleton," but
_unityContainer.RegisterType<TFrom, TTo>()without aContainerControlledLifetimeManagerregisters types as transient, not singleton. The comment appears inaccurate relative to the actual code behavior. -
Unused Constructor Parameter: Both attribute classes have constructors accepting a
string sparameter that is never used. This is likely required by attribute syntax constraints but serves no functional purpose. -
Redundant Image Initialization: In
AddCalculatedChannelModuleImageAttribute, the_imgfield is initialized both in the constructor and lazily in theAssemblyImagegetter. The constructor initialization is overwritten by the getter on first access. -
Empty
OnInitialized: TheOnInitializedmethod is intentionally empty. This is valid but may indicate initialization logic is handled elsewhere or deferred. -
ReSharper Suppressions: The file includes
// ReSharper disabledirectives forRedundantAttributeUsagePropertyandUnusedParameter.Local, suggesting known code style issues that were suppressed rather than addressed.