78 lines
4.0 KiB
Markdown
78 lines
4.0 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/View/TestSummaryView.xaml.cs
|
||
|
|
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/View/TestSummaryListView.xaml.cs
|
||
|
|
generated_at: "2026-04-16T13:55:15.087802+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "a0b85470cc6f6727"
|
||
|
|
---
|
||
|
|
|
||
|
|
# Documentation: DTS.Viewer.TestSummaryList Views
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module provides WPF view components for displaying and interacting with test summary data in the DTS Viewer application. It contains two code-behind classes (`TestSummaryView` and `TestSummaryListView`) that implement `ITestSummaryListView` and serve as the visual presentation layer for test summary lists. The module enables user interaction with test summary items, specifically allowing selection toggling via keyboard input.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### `TestSummaryView` (class)
|
||
|
|
**Namespace:** `DTS.Viewer.TestSummaryList`
|
||
|
|
**Implements:** `ITestSummaryListView`
|
||
|
|
|
||
|
|
| Member | Signature | Description |
|
||
|
|
|--------|-----------|-------------|
|
||
|
|
| Constructor | `public TestSummaryView()` | Initializes the view by calling `InitializeComponent()`. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### `TestSummaryListView` (class)
|
||
|
|
**Namespace:** `DTS.Viewer.TestSummaryList`
|
||
|
|
**Implements:** `ITestSummaryListView`
|
||
|
|
|
||
|
|
| Member | Signature | Description |
|
||
|
|
|--------|-----------|-------------|
|
||
|
|
| Constructor | `public TestSummaryListView()` | Initializes the view by calling `InitializeComponent()`. |
|
||
|
|
| `TestSummary_KeyUp` | `private void TestSummary_KeyUp(object sender, KeyEventArgs e)` | Event handler that toggles the `IsSelected` property on a `TestSummary` object when the Space key is released, provided the sender is a `ListView` with a `TestSummary` item selected. |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 3. Invariants
|
||
|
|
|
||
|
|
- Both view classes implement `ITestSummaryListView` interface from `DTS.Common.Interface`.
|
||
|
|
- `TestSummary_KeyUp` handler only processes keyboard events when:
|
||
|
|
- The `sender` can be cast to a `ListView`
|
||
|
|
- The `ListView.SelectedItem` can be cast to a `TestSummary` type
|
||
|
|
- When the Space key is pressed on a valid `TestSummary` item, `e.Handled` is set to `true`; otherwise, it is set to `false`.
|
||
|
|
- The `IsSelected` property on `TestSummary` is toggled (negated) on Space key release.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 4. Dependencies
|
||
|
|
|
||
|
|
### This module depends on:
|
||
|
|
| Dependency | Usage |
|
||
|
|
|------------|-------|
|
||
|
|
| `DTS.Common.Interface` | Provides `ITestSummaryListView` interface |
|
||
|
|
| `DTS.Common.Classes.Viewer.TestMetadata` | Provides `TestSummary` class |
|
||
|
|
| `DTS.Common.Interface.TestDefinition` | Imported but **not visibly used** in the provided source |
|
||
|
|
| `System.Windows` | WPF framework (`FrameworkElement`, `UIElement`) |
|
||
|
|
| `System.Windows.Controls` | Provides `ListView` control |
|
||
|
|
| `System.Windows.Input` | Provides `KeyEventArgs`, `Key` enum |
|
||
|
|
|
||
|
|
### What depends on this module:
|
||
|
|
- **Unclear from source alone** — consumers of `ITestSummaryListView` implementations are not visible in the provided files.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 5. Gotchas
|
||
|
|
|
||
|
|
1. **Two similarly-named classes exist:** Both `TestSummaryView` and `TestSummaryListView` implement the same interface (`ITestSummaryListView`) within the same namespace. The relationship and distinction between these two views is unclear from the source alone.
|
||
|
|
|
||
|
|
2. **Namespace suppression directive:** The file `TestSummaryListView.xaml.cs` contains `// ReSharper disable CheckNamespace`, suggesting a mismatch between the file location and the declared namespace. This may indicate the file was moved or the namespace was renamed without relocating the file.
|
||
|
|
|
||
|
|
3. **Unused import:** The namespace `DTS.Common.Interface.TestDefinition` is imported in `TestSummaryListView.xaml.cs` but no types from it are referenced in the visible code. This may be dead code or used in the XAML portion not shown.
|
||
|
|
|
||
|
|
4. **XAML partial not shown:** Both classes are `partial` and depend on XAML-generated code via `InitializeComponent()`. The actual UI layout, bindings, and event wire-up (e.g., how `TestSummary_KeyUp` is connected) are defined in the corresponding `.xaml` files, which are not provided.
|