6.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:05:54.984178+00:00 | zai-org/GLM-5-FP8 | 1 | b6bfcd5e53808ea8 |
Documentation: DTS.Viewer.Graph Module
1. Purpose
This module serves as the Prism module definition for the DTS.Viewer.Graph component within the DTS Viewer application. Its primary role is to register graph-related views and view models with the Unity dependency injection container during application startup. Additionally, it defines assembly-level attributes (GraphNameAttribute and GraphImageAttribute) that provide metadata—such as the assembly name, display image, and region assignment—likely used by the main application shell to dynamically discover and display this module.
2. Public Interface
Classes
GraphModule
Implements Prism.Modularity.IModule. The entry point for the module's configuration.
GraphModule(IUnityContainer unityContainer)- Constructor that accepts an
IUnityContainerinstance via dependency injection and stores it in a readonly field.
- Constructor that accepts an
void RegisterTypes(IContainerRegistry containerRegistry)- Implements
IModule.RegisterTypes. Calls the localInitialize()method to perform type registrations. Note that it ignores the passedIContainerRegistryin favor of the storedIUnityContainer.
- Implements
void OnInitialized(IContainerProvider containerProvider)- Implements
IModule.OnInitialized. Currently contains no implementation logic.
- Implements
void Initialize()- Registers types with the Unity container.
- Mappings:
IGraphView→GraphViewIGraphViewModel→GraphViewModelITestDataSeriesView→TestDataSeriesViewITestDataSeriesViewModel→TestDataSeriesViewModel
GraphNameAttribute
Inherits from DTS.Common.Interface.TextAttribute. Applied at the assembly level to define the module's name.
GraphNameAttribute()- Default constructor. Sets the internal assembly name to
AssemblyNames.Graph.ToString().
- Default constructor. Sets the internal assembly name to
GraphNameAttribute(string s)- Overloaded constructor. The parameter
sis accepted but ignored; the assembly name is hardcoded toAssemblyNames.Graph.ToString().
- Overloaded constructor. The parameter
override string AssemblyName(Property)- Returns the stored assembly name string.
override Type GetAttributeType()- Returns
typeof(TextAttribute).
- Returns
override string GetAssemblyName()- Returns the
AssemblyNameproperty value.
- Returns the
GraphImageAttribute
Inherits from DTS.Common.Interface.ImageAttribute. Applied at the assembly level to provide display metadata (image, group, region).
GraphImageAttribute()/GraphImageAttribute(string s)- Constructors. The string parameter
sis ignored. Initializes the image usingAssemblyInfo.GetImage.
- Constructors. The string parameter
override BitmapImage AssemblyImage(Property)- Loads and returns a
BitmapImageby callingAssemblyInfo.GetImage(AssemblyNames.Graph.ToString()).
- Loads and returns a
override string AssemblyName(Property)- Returns
AssemblyNames.Graph.ToString().
- Returns
override string AssemblyGroup(Property)- Returns
eAssemblyGroups.Viewer.ToString().
- Returns
override eAssemblyRegion AssemblyRegion(Property)- Returns
eAssemblyRegion.GraphRegion.
- Returns
- Methods:
GetAttributeType(),GetAssemblyImage(),GetAssemblyName(),GetAssemblyGroup(),GetAssemblyRegion()return the values of the respective properties described above.
3. Invariants
- Module Name: The module is identified by the string "Graph" via the
[Module(ModuleName = "Graph")]attribute. - Attribute Uniqueness:
GraphNameAttributeandGraphImageAttributeare applied at the assembly level withAllowMultiple = false, ensuring only one instance of each exists per assembly. - Naming Consistency: Both attribute classes hardcode the assembly name lookup to
AssemblyNames.Graph, ensuring the metadata matches the module identity. - Region Assignment: The module is statically assigned to
eAssemblyRegion.GraphRegion.
4. Dependencies
Internal Dependencies
DTS.Common: UsesAssemblyNames,eAssemblyGroups,eAssemblyRegion, andAssemblyInfo.DTS.Common.Interface: Defines base classesTextAttribute,ImageAttributeand interfacesIGraphView,IGraphViewModel,ITestDataSeriesView,ITestDataSeriesViewModel.- Local Views/ViewModels: References
GraphView,GraphViewModel,TestDataSeriesView,TestDataSeriesViewModel(types not provided in source, but referenced inInitialize).
External Dependencies
Prism.Ioc: UsesIContainerProvider,IContainerRegistry.Prism.Modularity: ImplementsIModule.Unity: UsesIUnityContainerandUnityattributes.System.Windows.Media.Imaging: UsesBitmapImagefor image handling.
5. Gotchas
- Unused Constructor Parameters: Both
GraphNameAttribute(string s)andGraphImageAttribute(string s)accept a string parameter that is completely ignored. This suggests a legacy API or a design intended for future expansion that was never implemented. - Side Effects in Property Getters: The
AssemblyImageproperty getter inGraphImageAttributeperforms logic (_img = AssemblyInfo.GetImage(...)). Accessing this property triggers image loading every time, which could be a performance concern if accessed frequently, though the private field_imgis reassigned each time. - Mixed Container Abstractions: The
RegisterTypesmethod receives anIContainerRegistry(Prism abstraction) but ignores it. Instead, it callsInitialize(), which uses the concreteIUnityContainerinjected via the constructor. This bypasses Prism's container abstraction, making it harder to swap containers later. - Commented Code: The
Initializemethod contains commented-out registrations forITestDataViewandITestDataViewModel. It is unclear if this is dead code or a feature in progress.