6.2 KiB
6.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T13:37:20.992121+00:00 | zai-org/GLM-5-FP8 | 1 | 272bb780c04413d3 |
Documentation: PSDReportSettingsModule
1. Purpose
This module serves as the entry point for the "PSD Report Settings" feature within the DTS Viewer application. It is a Prism Module (PSDReportSettingsModule) responsible for registering its specific View, ViewModel, and Model implementations with the Unity dependency injection container. Additionally, it defines assembly-level attributes to expose metadata (name, image, group, and region) to the main application shell, enabling the module to be discovered and displayed as an available component.
2. Public Interface
Class: PSDReportSettingsModule
Implements Prism.Modularity.IModule.
- Constructor:
PSDReportSettingsModule(IUnityContainer unityContainer)- Accepts an
IUnityContainerinstance via constructor injection and stores it in a readonly field.
- Accepts an
- Method:
void Initialize()- Registers three type mappings in the Unity container:
IPSDReportSettingsViewModelmapped toPSDReportSettingsViewModel.IPSDReportSettingsModelmapped toPSDReportSettingsModel.IPSDReportSettingsViewmapped toPSDReportSettingsView.
- Registers three type mappings in the Unity container:
- Method:
void RegisterTypes(IContainerRegistry containerRegistry)- Implements
IModule.RegisterTypes. It invokes theInitialize()method.
- Implements
- Method:
void OnInitialized(IContainerProvider containerProvider)- Implements
IModule.OnInitialized. This method is currently empty.
- Implements
Class: PSDReportSettingsModuleNameAttribute
Inherits from TextAttribute.
- Constructor:
PSDReportSettingsModuleNameAttribute()/PSDReportSettingsModuleNameAttribute(string s)- Hardcodes the
AssemblyNameproperty toAssemblyNames.PSDReportSettings.ToString(). The string argumentsin the overloaded constructor is ignored.
- Hardcodes the
- Property:
string AssemblyName { get; }- Returns the hardcoded assembly name string.
- Method:
Type GetAttributeType()- Returns
typeof(TextAttribute).
- Returns
- Method:
string GetAssemblyName()- Returns the value of the
AssemblyNameproperty.
- Returns the value of the
Class: PSDReportSettingsModuleImageAttribute
Inherits from ImageAttribute.
- Constructor:
PSDReportSettingsModuleImageAttribute()/PSDReportSettingsModuleImageAttribute(string s)- Initializes a private
BitmapImagefield (_img) by callingAssemblyInfo.GetImage. The string argumentsis ignored.
- Initializes a private
- Property:
BitmapImage AssemblyImage { get; }- Gets the image by calling
AssemblyInfo.GetImagewith theAssemblyNames.PSDReportSettingsenum value.
- Gets the image by calling
- Property:
string AssemblyName { get; }- Returns
AssemblyNames.PSDReportSettings.ToString().
- Returns
- Property:
string AssemblyGroup { get; }- Returns
eAssemblyGroups.Viewer.ToString().
- Returns
- Property:
eAssemblyRegion AssemblyRegion { get; }- Returns
eAssemblyRegion.PSDReportSettingsRegion.
- Returns
- Methods:
Type GetAttributeType(): Returnstypeof(ImageAttribute).BitmapImage GetAssemblyImage(): ReturnsAssemblyImage.string GetAssemblyName(): ReturnsAssemblyName.string GetAssemblyGroup(): ReturnsAssemblyGroup.eAssemblyRegion GetAssemblyRegion(): ReturnsAssemblyRegion.
3. Invariants
- Module Name: The Prism module is identified by the string
"PSDReportSettings"via the[Module]attribute. - Assembly Attributes: The assembly is decorated with both
PSDReportSettingsModuleNameAttributeandPSDReportSettingsModuleImageAttributewithAllowMultiple = false. - Registration Mapping: The
Initializemethod guarantees thatIPSDReportSettingsViewModel,IPSDReportSettingsModel, andIPSDReportSettingsVieware registered with the container upon module initialization. - Region Assignment: This module is statically bound to the region
eAssemblyRegion.PSDReportSettingsRegion.
4. Dependencies
Internal Dependencies
- DTS.Common: Referenced for
AssemblyNames,AssemblyInfo,eAssemblyGroups, andeAssemblyRegion. - DTS.Common.Interface: Referenced for base classes
TextAttributeandImageAttribute. - Local Types: The module depends on the existence of
PSDReportSettingsViewModel,PSDReportSettingsModel, andPSDReportSettingsView(and their corresponding interfaces), though these types are not defined in the provided source snippet.
External Dependencies
- Prism.Ioc: For
IContainerProviderandIContainerRegistry. - Prism.Modularity: For
IModuleandModuleAttribute. - Unity: For
IUnityContainer(used for specific registration logic). - System.Windows.Media.Imaging: For
BitmapImage.
Consumers
- The DTS Viewer main application shell (inferred from the module structure and
eAssemblyGroups.Viewergroup assignment).
5. Gotchas
- Mixed Container Abstractions: The module implements
IModule, which provides aRegisterTypes(IContainerRegistry containerRegistry)method intended for container-agnostic registration. However, the implementation ignores thecontainerRegistryargument and instead uses the injectedIUnityContainerinstance via theInitialize()method. This ties the module specifically to Unity, bypassing Prism's container abstraction layer. - Redundant Constructor Arguments: Both attribute classes possess constructors accepting a
string sargument. This argument is unused in both constructors, suggesting legacy code or a requirement of the base attribute constructor signature that was implemented but not utilized. - Property Side Effects: In
PSDReportSettingsModuleImageAttribute, the getter forAssemblyImagere-executesAssemblyInfo.GetImage(...)and reassigns the private field_imgevery time it is accessed, rather than returning the cached value. - Empty OnInitialized: The
OnInitializedmethod is explicitly empty. If the View needs to be loaded into a region automatically upon startup, that logic is absent from this module class.