11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T13:42:43.875292+00:00 | zai-org/GLM-5-FP8 | 1 | 267c5c22d55f0847 |
Documentation: GraphList and ExportGraphList Modules
1. Purpose
This documentation covers two related Prism modules within the DTS Viewer application: GraphListModule and ExportGraphListModule. Both modules serve as plugin-like components that register their respective views and view models with the Unity dependency injection container at application startup. They expose assembly metadata (name, image, group, region) through custom attributes, enabling the main application shell to discover and display them as available components. The modules appear to provide graph visualization/listing functionality, with the export variant likely offering a specialized view for exporting graph data.
2. Public Interface
GraphListModule Class
Namespace: DTS.Viewer.GraphList
| Member | Signature | Description |
|---|---|---|
| Constructor | GraphListModule(IUnityContainer unityContainer) |
Accepts an injected Unity container instance and stores it in _unityContainer. |
RegisterTypes |
void RegisterTypes(IContainerRegistry containerRegistry) |
Implements IModule.RegisterTypes. Delegates to Initialize(). |
OnInitialized |
void OnInitialized(IContainerProvider containerProvider) |
Implements IModule.OnInitialized. Currently empty (no-op). |
Initialize |
void Initialize() |
Registers IGraphMainView → GraphMainView and IGraphMainViewModel → GraphMainViewModel with the Unity container. |
GraphListNameAttribute Class
Namespace: DTS.Viewer.GraphList
| Member | Signature | Description |
|---|---|---|
| Constructor | GraphListNameAttribute() |
Default constructor. |
| Constructor | GraphListNameAttribute(string s) |
Overloaded constructor accepting a string parameter (unused). Sets _assemblyName to AssemblyNames.GraphList.ToString(). |
AssemblyName |
override string AssemblyName { get; } |
Returns the stored assembly name. |
GetAttributeType |
override Type GetAttributeType() |
Returns typeof(TextAttribute). |
GetAssemblyName |
override string GetAssemblyName() |
Returns AssemblyName property value. |
GraphListImageAttribute Class
Namespace: DTS.Viewer.GraphList
| Member | Signature | Description |
|---|---|---|
| Constructor | GraphListImageAttribute() |
Default constructor. |
| Constructor | GraphListImageAttribute(string s) |
Overloaded constructor. Loads image via AssemblyInfo.GetImage(AssemblyNames.GraphList.ToString()). |
AssemblyImage |
override BitmapImage AssemblyImage { get; } |
Lazy-loads and returns the assembly image. |
AssemblyName |
override string AssemblyName { get; } |
Returns AssemblyNames.GraphList.ToString(). |
AssemblyGroup |
override string AssemblyGroup { get; } |
Returns eAssemblyGroups.Viewer.ToString(). |
AssemblyRegion |
override eAssemblyRegion AssemblyRegion { get; } |
Returns eAssemblyRegion.GraphListRegion. |
GetAttributeType |
override Type GetAttributeType() |
Returns typeof(ImageAttribute). |
GetAssemblyImage |
override BitmapImage GetAssemblyImage() |
Returns AssemblyImage property. |
GetAssemblyName |
override string GetAssemblyName() |
Returns AssemblyName property. |
GetAssemblyGroup |
override string GetAssemblyGroup() |
Returns AssemblyGroup property. |
GetAssemblyRegion |
override eAssemblyRegion GetAssemblyRegion() |
Returns AssemblyRegion property. |
ExportGraphListModule Class
Namespace: DTS.Viewer.Export
| Member | Signature | Description |
|---|---|---|
| Constructor | ExportGraphListModule(IUnityContainer unityContainer) |
Accepts an injected Unity container instance and stores it in _unityContainer. |
RegisterTypes |
void RegisterTypes(IContainerRegistry containerRegistry) |
Implements IModule.RegisterTypes. Delegates to Initialize(). |
OnInitialized |
void OnInitialized(IContainerProvider containerProvider) |
Implements IModule.OnInitialized. Currently empty (no-op). |
Initialize |
void Initialize() |
Registers IExportGraphMainView → ExportGraphMainView and IExportGraphMainViewModel → ExportGraphMainViewModel with the Unity container. |
ExportGraphListNameAttribute Class
Namespace: DTS.Viewer.Export
| Member | Signature | Description |
|---|---|---|
| Constructor | ExportGraphListNameAttribute() |
Default constructor. |
| Constructor | ExportGraphListNameAttribute(string s) |
Overloaded constructor accepting a string parameter (unused). Sets _assemblyName to AssemblyNames.GraphList.ToString(). |
AssemblyName |
override string AssemblyName { get; } |
Returns the stored assembly name. |
GetAttributeType |
override Type GetAttributeType() |
Returns typeof(TextAttribute). |
GetAssemblyName |
override string GetAssemblyName() |
Returns AssemblyName property value. |
ExportGraphListImageAttribute Class
Namespace: DTS.Viewer.Export
| Member | Signature | Description |
|---|---|---|
| Constructor | ExportGraphListImageAttribute() |
Default constructor. |
| Constructor | ExportGraphListImageAttribute(string s) |
Overloaded constructor. Loads image via AssemblyInfo.GetImage(AssemblyNames.GraphList.ToString()). |
AssemblyImage |
override BitmapImage AssemblyImage { get; } |
Lazy-loads and returns the assembly image. |
AssemblyName |
override string AssemblyName { get; } |
Returns AssemblyNames.GraphList.ToString(). |
AssemblyGroup |
override string AssemblyGroup { get; } |
Returns eAssemblyGroups.Viewer.ToString(). |
AssemblyRegion |
override eAssemblyRegion AssemblyRegion { get; } |
Returns eAssemblyRegion.GraphListRegion. |
GetAttributeType |
override Type GetAttributeType() |
Returns typeof(ImageAttribute). |
GetAssemblyImage |
override BitmapImage GetAssemblyImage() |
Returns AssemblyImage property. |
GetAssemblyName |
override string GetAssemblyName() |
Returns AssemblyName property. |
GetAssemblyGroup |
override string GetAssemblyGroup() |
Returns AssemblyGroup property. |
GetAssemblyRegion |
override eAssemblyRegion GetAssemblyRegion() |
Returns AssemblyRegion property. |
3. Invariants
- Module Naming Convention:
GraphListModulehasModuleName = "GraphList";ExportGraphListModulehasModuleName = "ExportGraphList". - Attribute Application: Both
GraphListNameAttribute/GraphListImageAttributeandExportGraphListNameAttribute/ExportGraphListImageAttributeare applied at assembly level withAllowMultiple = false. - Registration Pattern: Both modules register interface-to-concrete-type mappings (view and view model) via
RegisterType<TInterface, TImplementation>(). - Assembly Name Consistency: Both attribute families return
AssemblyNames.GraphList.ToString()forAssemblyName, despiteExportGraphListModuleresiding in a different namespace (DTS.Viewer.Export). - Region Assignment: Both modules declare
eAssemblyRegion.GraphListRegionas their target region. - Group Assignment: Both modules declare
eAssemblyGroups.Vieweras their assembly group.
4. Dependencies
External Dependencies (Imports)
| Dependency | Usage |
|---|---|
System |
Core .NET types (Type, AttributeUsage, AttributeTargets). |
System.Windows.Media.Imaging |
BitmapImage for assembly images. |
DTS.Common |
AssemblyNames, eAssemblyGroups, eAssemblyRegion enums; AssemblyInfo utility class. |
DTS.Common.Interface |
TextAttribute, ImageAttribute base classes. |
Prism.Ioc |
IContainerProvider, IContainerRegistry interfaces. |
Prism.Modularity |
IModule interface, ModuleAttribute. |
Unity |
IUnityContainer for dependency injection. |
Internal Dependencies (Inferred)
| Dependency | Reason |
|---|---|
GraphMainView |
Concrete view class registered by GraphListModule. |
GraphMainViewModel |
Concrete view model class registered by GraphListModule. |
IGraphMainView |
Interface registered by GraphListModule. |
IGraphMainViewModel |
Interface registered by GraphListModule. |
ExportGraphMainView |
Concrete view class registered by ExportGraphListModule. |
ExportGraphMainViewModel |
Concrete view model class registered by ExportGraphListModule. |
IExportGraphMainView |
Interface registered by ExportGraphListModule. |
IExportGraphMainViewModel |
Interface registered by ExportGraphListModule. |
Consumers (Inferred)
- The main application shell that discovers and loads Prism modules.
- Any code that reflects over assemblies looking for
TextAttributeorImageAttributemetadata.
5. Gotchas
-
Duplicate Assembly Name:
ExportGraphListModuleusesAssemblyNames.GraphList.ToString()for itsAssemblyNameproperty, identical toGraphListModule. This may cause ambiguity if the application shell uses assembly name to uniquely identify modules. It is unclear whether this is intentional (shared identity) or a bug. -
Shared Region: Both modules target
eAssemblyRegion.GraphListRegion. If the shell only supports one view per region, one module may overwrite or conflict with the other. -
Unused Constructor Parameter: Both
*NameAttributeand*ImageAttributeconstructors accept astring sparameter that is never used. The parameter is ignored in all implementations. -
Redundant Getter Side Effects: In
*ImageAttributeclasses, theAssemblyImagegetter has a side effect: it assigns_imgbefore returning it. This means_imgis re-fetched fromAssemblyInfo.GetImage()on every access, potentially causing unnecessary I/O or memory allocation if called repeatedly. -
Empty
OnInitialized: Both modules implementOnInitializedas a no-op. If module initialization logic is expected here, it is missing. -
Initialize()Called fromRegisterTypes(): TheInitialize()method is called withinRegisterTypes(), which is non-standard for Prism modules. Typically, type registration happens inRegisterTypes()and runtime initialization inOnInitialized(). This pattern works but conflates registration with initialization. -
Missing Singleton Registration: The comments indicate "Register View & View-Model... as a singleton," but
RegisterTypeis used withoutContainerControlledLifetimeManager, which registers types as transient (new instance per resolve) by default in Unity. If singleton behavior is intended, this appears to be incorrect.