5.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T10:59:04.135002+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 associated View, ViewModel, and Model dependencies with the Unity dependency injection container. Additionally, it defines assembly-level attributes to expose metadata (name, image, grouping, and region) to the main application shell, allowing the module to be discovered and displayed in the UI as an available component.
2. Public Interface
Classes
PSDReportSettingsModule
Inherits from: IModule
PSDReportSettingsModule(IUnityContainer unityContainer): Constructor that accepts aIUnityContainerinstance and stores it in a readonly field.void RegisterTypes(IContainerRegistry containerRegistry): ImplementsIModule.RegisterTypes. Executes theInitialize()method to register types with the container.void OnInitialized(IContainerProvider containerProvider): ImplementsIModule.OnInitialized. Currently contains no implementation logic.void Initialize(): Registers the following interface-to-concrete-type mappings using the injected_unityContainer:IPSDReportSettingsViewModel→PSDReportSettingsViewModelIPSDReportSettingsModel→PSDReportSettingsModelIPSDReportSettingsView→PSDReportSettingsView
PSDReportSettingsModuleNameAttribute
Inherits from: TextAttribute
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]PSDReportSettingsModuleNameAttribute(): Default constructor.PSDReportSettingsModuleNameAttribute(string s): Overloaded constructor (parametersis unused).string AssemblyName { get; }: Overrides the base property. Returns the string representation ofAssemblyNames.PSDReportSettings.Type GetAttributeType(): Returnstypeof(TextAttribute).string GetAssemblyName(): Returns the value of theAssemblyNameproperty.
PSDReportSettingsModuleImageAttribute
Inherits from: ImageAttribute
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]PSDReportSettingsModuleImageAttribute(): Default constructor.PSDReportSettingsModuleImageAttribute(string s): Overloaded constructor (parametersis unused).BitmapImage AssemblyImage { get; }: Returns aBitmapImageretrieved viaAssemblyInfo.GetImage(AssemblyNames.PSDReportSettings.ToString()).string AssemblyName { get; }: Returns the string representation ofAssemblyNames.PSDReportSettings.string AssemblyGroup { get; }: ReturnseAssemblyGroups.Viewer.ToString().eAssemblyRegion AssemblyRegion { get; }: ReturnseAssemblyRegion.PSDReportSettingsRegion.Type GetAttributeType(): Returnstypeof(ImageAttribute).BitmapImage GetAssemblyImage(): ReturnsAssemblyImage.string GetAssemblyName(): ReturnsAssemblyName.string GetAssemblyGroup(): ReturnsAssemblyGroup.eAssemblyRegion GetAssemblyRegion(): ReturnsAssemblyRegion.
3. Invariants
- Module Name: The module is identified by the string
"PSDReportSettings"in the[Module]attribute. - Assembly Group: The module belongs to the
Viewerassembly group (defined byeAssemblyGroups.Viewer). - Region: The module is associated with the
PSDReportSettingsRegion(defined byeAssemblyRegion.PSDReportSettingsRegion). - Registration: The types
IPSDReportSettingsViewModel,IPSDReportSettingsModel, andIPSDReportSettingsVieware registered with the Unity container as transient types (defaultRegisterTypebehavior) upon module initialization.
4. Dependencies
Internal Dependencies (referenced types):
DTS.Common: UsesAssemblyNamesenum.DTS.Common.Interface: UsesTextAttribute,ImageAttribute,eAssemblyGroups,eAssemblyRegion. Also implies the existence ofIPSDReportSettingsViewModel,IPSDReportSettingsModel, andIPSDReportSettingsViewinterfaces.DTS.Viewer.PSDReportSettings: UsesPSDReportSettingsViewModel,PSDReportSettingsModel,PSDReportSettingsViewconcrete classes andAssemblyInfostatic class.
External Frameworks:
Prism.Ioc: UsesIContainerProvider,IContainerRegistry.Prism.Modularity: UsesIModule,ModuleAttribute.Unity: UsesIUnityContainer.System.Windows.Media.Imaging: UsesBitmapImage.
5. Gotchas
- Ignored Constructor Parameters: Both
PSDReportSettingsModuleNameAttributeandPSDReportSettingsModuleImageAttributehave constructors that accept astring sparameter, but this parameter is completely ignored in the logic. It is unclear why this parameter exists. - Mixed Container Usage: The
RegisterTypesmethod receives anIContainerRegistry(Prism abstraction) but the actual registration logic insideInitialize()uses the injectedIUnityContainer(Unity specific). This bypasses the Prism abstraction layer, which could cause issues if the container implementation details differ or if the container wrapper is expected to manage lifestyle scopes. - Property Getter Side Effects: In
PSDReportSettingsModuleImageAttribute, theAssemblyImageproperty getter performs a method callAssemblyInfo.GetImage(...)and assigns it to the private field_imgevery time the getter is accessed. This is not a pure getter; it causes a new image lookup (and potentially a new object allocation) on every read access, rather than returning a cached value. - Empty OnInitialized: The
OnInitializedmethod is empty. If the module requires runtime initialization logic (like starting services or registering region views), it is not present here. The module currently only performs type registration.