6.3 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:06:39.911928+00:00 | zai-org/GLM-5-FP8 | 1 | bcd5ac559d7f6d8e |
Documentation: ChartOptionsModule.cs
1. Purpose
This module serves as the Prism module initializer for the DTS.Viewer.ChartOptions component within the DTS Viewer application. It is responsible for registering the chart options View, ViewModel, and Model with the Unity dependency injection container, and provides assembly-level metadata (name, image, group, and region) that the main application uses to identify and display this module as an available component.
2. Public Interface
ChartOptionsModule (Class)
Implements Prism.Modularity.IModule. The primary module entry point for the ChartOptions feature.
| Member | Signature | Description |
|---|---|---|
| Constructor | ChartOptionsModule(IUnityContainer unityContainer) |
Accepts an injected IUnityContainer instance and stores it in _unityContainer. |
RegisterTypes |
void RegisterTypes(IContainerRegistry containerRegistry) |
Calls Initialize() to perform type registrations. Required by IModule. |
OnInitialized |
void OnInitialized(IContainerProvider containerProvider) |
Empty implementation. Required by IModule. |
Initialize |
void Initialize() |
Registers three type mappings with Unity: IChartOptionsView → ChartOptionsView, IChartOptionsViewModel → ChartOptionsViewModel, IChartOptionsModel → ChartOptionsModel. |
ChartOptionsModuleNameAttribute (Class)
Inherits from TextAttribute. Assembly-level attribute providing the module's name.
| Member | Signature | Description |
|---|---|---|
| Constructor | ChartOptionsModuleNameAttribute() |
Default constructor. |
| Constructor | ChartOptionsModuleNameAttribute(string s) |
Overloaded constructor; parameter s is unused. |
AssemblyName |
override string AssemblyName { get; } |
Returns AssemblyNames.ChartOptions.ToString(). |
GetAttributeType |
override Type GetAttributeType() |
Returns typeof(TextAttribute). |
GetAssemblyName |
override string GetAssemblyName() |
Returns AssemblyName. |
ChartOptionsModuleImageAttribute (Class)
Inherits from ImageAttribute. Assembly-level attribute providing the module's image, name, group, and region metadata.
| Member | Signature | Description |
|---|---|---|
| Constructor | ChartOptionsModuleImageAttribute() |
Default constructor. |
| Constructor | ChartOptionsModuleImageAttribute(string s) |
Overloaded constructor; parameter s is unused. |
AssemblyImage |
override BitmapImage AssemblyImage { get; } |
Lazily loads and returns image via AssemblyInfo.GetImage(AssemblyNames.ChartOptions.ToString()). |
AssemblyName |
override string AssemblyName { get; } |
Returns AssemblyNames.ChartOptions.ToString(). |
AssemblyGroup |
override string AssemblyGroup { get; } |
Returns eAssemblyGroups.Viewer.ToString(). |
AssemblyRegion |
override eAssemblyRegion AssemblyRegion { get; } |
Returns eAssemblyRegion.ChartOptionsRegion. |
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
- The module is registered with Prism under the name
"DTS.Viewer.ChartOptions". - Both assembly attributes are applied with
AllowMultiple = false, ensuring exactly one instance of each attribute per assembly. AssemblyNamefor both attributes always returnsAssemblyNames.ChartOptions.ToString().AssemblyGroupforChartOptionsModuleImageAttributealways returnseAssemblyGroups.Viewer.ToString().AssemblyRegionforChartOptionsModuleImageAttributealways returnseAssemblyRegion.ChartOptionsRegion.- Type registrations occur exactly once during module initialization via
RegisterTypes.
4. Dependencies
This Module Depends On:
System- Core .NET framework.System.Windows.Media.Imaging- ForBitmapImageused in module image.DTS.Common- Likely containsAssemblyNamesenum andAssemblyInfoutility class.DTS.Common.Interface- ContainsTextAttribute,ImageAttribute,eAssemblyGroups, andeAssemblyRegion.DTS.Viewer.ChartOptions.Model- ContainsIChartOptionsModelandChartOptionsModel(inferred from usage).Prism.Ioc- ForIContainerProviderandIContainerRegistry.Prism.Modularity- ForIModuleandModuleAttribute.Unity- ForIUnityContainerand DI registration.
What Depends On This Module:
- The main DTS Viewer application shell, which discovers and loads this module via Prism's module system.
- The
ChartOptionsView,ChartOptionsViewModel, andChartOptionsModelimplementations (referenced but not defined in this file).
5. Gotchas
-
Comment claims singleton, code does not enforce it: The comment in
Initialize()states "Register View & View-Model with Unity dependency injection container as a singleton," butRegisterTypewithout aContainerControlledLifetimeManagerregisters types as transient (new instance per resolve), not singleton. If singleton behavior is intended, this is a bug. -
Unused constructor parameters: Both
ChartOptionsModuleNameAttribute(string s)andChartOptionsModuleImageAttribute(string s)accept a string parameter that is never used. This may be dead code or a remnant of a base class contract. -
Side effects in property getters:
AssemblyImageproperty has a side effect of assigning to the private_imgfield on every get. Similarly,_nameand_groupare assigned in their respective property getters. This is unconventional and could cause unexpected behavior if properties are accessed multiple times. -
Empty
OnInitializedimplementation: TheOnInitializedmethod is required byIModulebut is empty. It is unclear whether this is intentional or represents incomplete initialization logic.