Files
DP44/docs/ai/DTS Viewer/DTS.Viewer.md
2026-04-17 14:55:32 -04:00

77 lines
4.4 KiB
Markdown

---
source_files:
- DTS Viewer/DTS.Viewer/Settings.cs
- DTS Viewer/DTS.Viewer/ExportModule.cs
- DTS Viewer/DTS.Viewer/ViewerModule.cs
- DTS Viewer/DTS.Viewer/ViewerSession.cs
- DTS Viewer/DTS.Viewer/Bootstrapper.cs
generated_at: "2026-04-17T15:52:11.356156+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "709406bac3f2dc81"
---
# DTS.Viewer Module Documentation
## 1. Purpose
The `DTS.Viewer` namespace provides the core session management and module infrastructure for a Prism-based WPF application. It orchestrates the bootstrapping process, plugin loading, and module initialization for both standalone and integrated modes. The module manages two primary functional modules (`ExportModule` and `ViewerModule`) that communicate via an event aggregation system, and provides a `ViewerSession` class that serves as the main entry point for initializing the entire viewer framework.
---
## 2. Public Interface
### Settings.cs
**Class: `DTS.Viewer.Properties.Settings`** (internal sealed partial)
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `Settings()` | Default constructor with commented-out event handler subscriptions. |
| `SettingChangingEventHandler` | `void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)` | Handler for the `SettingChanging` event. Currently empty implementation. |
| `SettingsSavingEventHandler` | `void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)` | Handler for the `SettingsSaving` event. Currently empty implementation. |
---
### ExportModule.cs
**Class: `DTS.Viewer.ExportModule`** (implements `IExportModule`)
| Member | Signature | Description |
|--------|-----------|-------------|
| `SessionStarted` | `bool SessionStarted { get; private set; }` | Indicates whether a session has been started. Set to `true` after `StartSession()` completes. |
| Constructor | `ExportModule(IUnityContainer unityContainer)` | Accepts an injected `IUnityContainer` instance. |
| `Initialize` | `void Initialize()` | Registers `IExportModule` to `ExportModule` with `ContainerControlledLifetimeManager` (singleton). |
| `StartSession` | `void StartSession()` | Resolves `IEventAggregator`, publishes `LoadExportModuleEvent` with `LoadExportModuleArg`, and sets `SessionStarted = true`. |
| `RegisterTypes` | `void RegisterTypes(IContainerRegistry containerRegistry)` | Calls `Initialize()`. |
| `OnInitialized` | `void OnInitialized(IContainerProvider containerProvider)` | Empty implementation. |
**Class: `DTS.Viewer.ExportNameAttribute`** (extends `TextAttribute`)
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `ExportNameAttribute()` | Default constructor, calls `this(null)`. |
| Constructor | `ExportNameAttribute(string s)` | Ignores parameter `s`; sets `_assemblyName = "Export"`. |
| `AssemblyName` | `string AssemblyName { get; }` | Returns hardcoded `"Export"`. |
| `GetAttributeType` | `Type GetAttributeType()` | Returns `typeof(TextAttribute)`. |
| `GetAssemblyName` | `string GetAssemblyName()` | Returns `AssemblyName` property value. |
---
### ViewerModule.cs
**Class: `DTS.Viewer.ViewerModule`** (implements `IViewerModule`)
| Member | Signature | Description |
|--------|-----------|-------------|
| `SessionStarted` | `bool SessionStarted { get; private set; }` | Indicates whether a session has been started. Set to `true` after `StartSession()` completes. |
| Constructor | `ViewerModule(IUnityContainer unityContainer)` | Accepts an injected `IUnityContainer` instance. |
| `Initialize` | `void Initialize()` | Registers `IViewerModule` to `ViewerModule` with `ContainerControlledLifetimeManager` (singleton). |
| `StartSession` | `void StartSession()` | Resolves `IEventAggregator`, publishes `LoadViewModulEvent` with `LoadViewModulArg`, and sets `SessionStarted = true`. |
| `RegisterTypes` | `void RegisterTypes(IContainerRegistry containerRegistry)` | Calls `Initialize()`. |
| `OnInitialized` | `void OnInitialized(IContainerProvider containerProvider)` | Empty implementation. |
**Class: `DTS.Viewer.ViewerNameAttribute`** (extends `TextAttribute`)
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `ViewerNameAttribute()` | Default constructor, calls `this(null)`. |
| Constructor | `ViewerNameAttribute(string s)` | Ignores parameter `s`; sets `_assemblyName = "Viewer"`. |
| `AssemblyName` | `string