Files
DP44/docs/ai/DataPRO/Modules/TestSetups/TestSetupsList.md
2026-04-17 14:55:32 -04:00

3.5 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/TestSetups/TestSetupsList/TestSetupsListModule.cs
2026-04-17T16:16:03.433616+00:00 zai-org/GLM-5-FP8 1 24fc77cec6a51f5c

TestSetupsList

Purpose

This module serves as the Prism module initializer for the TestSetupsList feature, responsible for registering the TestSetupsList view and view model with the Unity dependency injection container. It provides assembly metadata (name, image, group, and region) used by the application shell to display and categorize the module within the "Prepare" assembly group.

Public Interface

TestSetupsListModule

  • TestSetupsListModule(IUnityContainer unityContainer) - Constructor accepting the injected Unity container.
  • void Initialize() - Registers ITestSetupsListViewTestSetupsListView and ITestSetupsListViewModelTestSetupsListViewModel with Unity (non-singleton registration via RegisterType).
  • void OnInitialized(IContainerProvider containerProvider) - Empty implementation, no initialization logic.
  • void RegisterTypes(IContainerRegistry containerRegistry) - Delegates to Initialize().

TestSetupsListModuleNameAttribute (extends TextAttribute)

  • string AssemblyName { get; } - Returns AssemblyNames.TestSetupsList.ToString().
  • Type GetAttributeType() - Returns typeof(TextAttribute).
  • string GetAssemblyName() - Returns the assembly name.

TestSetupsListModuleImageAttribute (extends ImageAttribute)

  • BitmapImage AssemblyImage { get; } - Loads image via AssemblyInfo.GetImage(AssemblyNames.TestSetupsList.ToString()).
  • string AssemblyName { get; } - Returns AssemblyNames.TestSetupsList.ToString().
  • string AssemblyGroup { get; } - Returns eAssemblyGroups.Prepare.ToString().
  • eAssemblyRegion AssemblyRegion { get; } - Returns eAssemblyRegion.TestSetupsListRegion.
  • BitmapImage GetAssemblyImage(), string GetAssemblyName(), string GetAssemblyGroup(), eAssemblyRegion GetAssemblyRegion() - Accessor methods for respective properties.

Invariants

  • The module must be constructed with a non-null IUnityContainer instance.
  • Assembly-level attributes TestSetupsListModuleName and TestSetupsListModuleImageAttribute are applied exactly once per assembly (AllowMultiple = false).
  • The module is exported as IModule and registered with Prism's module catalog under the name "TestSetupsListModule".

Dependencies

Depends on:

  • DTS.Common (provides AssemblyNames, AssemblyInfo, eAssemblyGroups, eAssemblyRegion, TextAttribute, ImageAttribute)
  • DTS.Common.Interface
  • DTS.Common.Interface.TestSetups.TestSetupsList (provides ITestSetupsListView, ITestSetupsListViewModel)
  • Prism.Ioc, Prism.Modularity (provides IModule, IContainerProvider, IContainerRegistry)
  • Unity (provides IUnityContainer)
  • System.ComponentModel.Composition (provides ExportAttribute)

Depended on by: Not determinable from source alone (likely the main application shell/bootstrapper).

Gotchas

  • The view and view model are registered via RegisterType, meaning a new instance is created each time they are resolved—not a singleton. The comment in Initialize() says "as a singleton" but the code uses RegisterType without ContainerControlledLifetimeManager, which is inconsistent.
  • OnInitialized is empty while RegisterTypes calls Initialize(); this dual-path initialization pattern may cause confusion about when registration actually occurs.