173 lines
6.9 KiB
Markdown
173 lines
6.9 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/IMainView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/IMenuView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/IFilterView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/INavigationView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/ITestDefinitionListView.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/IMenuViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/INavigationViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/IFilterViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/ITestDefinitionListViewModel.cs
|
||
|
|
- Common/DTS.CommonCore/Interface/Viewer/IMainViewModel.cs
|
||
|
|
generated_at: "2026-04-16T12:16:35.672388+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "d625778ef337fcd6"
|
||
|
|
---
|
||
|
|
|
||
|
|
# Documentation: DTS.Common.Interface Viewer Interfaces
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module defines a set of view and view model interfaces for the DTS application's viewer components, implementing a Model-View-ViewModel (MVVM) architecture. These interfaces establish contracts for UI composition using a region-based pattern, where views are injected into named context regions (navigation, graphs, tests, legends, etc.). The module serves as the abstraction layer between concrete view implementations and the presentation logic, enabling loose coupling and testability of the viewer subsystem.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### View Interfaces
|
||
|
|
|
||
|
|
All view interfaces inherit from `IBaseView` (defined in `DTS.Common.Base`) and currently declare no additional members.
|
||
|
|
|
||
|
|
| Interface | File | Description |
|
||
|
|
|-----------|------|-------------|
|
||
|
|
| `IMainView` | `IMainView.cs` | Marker interface for the main view. |
|
||
|
|
| `IMenuView` | `IMenuView.cs` | Marker interface for menu view components. |
|
||
|
|
| `IFilterView` | `IFilterView.cs` | Marker interface for filter view components. |
|
||
|
|
| `INavigationView` | `INavigationView.cs` | Marker interface for navigation view components. |
|
||
|
|
| `ITestSummaryListView` | `ITestDefinitionListView.cs` | Marker interface for test summary list display. |
|
||
|
|
|
||
|
|
### ViewModel Interfaces
|
||
|
|
|
||
|
|
#### `IMenuViewModel` (`IMenuViewModel.cs`)
|
||
|
|
```csharp
|
||
|
|
public interface IMenuViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IMenuView View { get; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
Provides access to the associated `IMenuView` instance.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
#### `INavigationViewModel` (`INavigationViewModel.cs`)
|
||
|
|
```csharp
|
||
|
|
public interface INavigationViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
INavigationView NavigationView { get; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
Provides access to the associated `INavigationView` instance.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
#### `IFilterViewModel` (`IFilterViewModel.cs`)
|
||
|
|
```csharp
|
||
|
|
public interface IFilterViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IBaseView View { get; }
|
||
|
|
IBaseViewModel Parent { get; }
|
||
|
|
object ContextSearchRegion { get; set; }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
Manages filter/search functionality with:
|
||
|
|
- `View`: The associated view (typed as `IBaseView`, not `IFilterView`)
|
||
|
|
- `Parent`: Reference to the parent view model in the hierarchy
|
||
|
|
- `ContextSearchRegion`: A region context for search-related UI composition
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
#### `ITestSummaryListViewModel` (`ITestDefinitionListViewModel.cs`)
|
||
|
|
```csharp
|
||
|
|
public interface ITestSummaryListViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
ITestSummaryListView TestSummaryListView { get; }
|
||
|
|
ObservableCollection<ITestSummary> TestSummaryList { get; set; }
|
||
|
|
List<ITestSummary> SelectedTestSummaryList { get; set; }
|
||
|
|
void PublishSelectedTestSummaryList();
|
||
|
|
}
|
||
|
|
```
|
||
|
|
Manages a collection of test summaries with:
|
||
|
|
- `TestSummaryListView`: The associated view
|
||
|
|
- `TestSummaryList`: Bindable collection of `ITestSummary` objects
|
||
|
|
- `SelectedTestSummaryList`: Tracks user-selected test summaries
|
||
|
|
- `PublishSelectedTestSummaryList()`: Notifies subscribers of selection changes
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
#### `IMainViewModel` (`IMainViewModel.cs`)
|
||
|
|
```csharp
|
||
|
|
public interface IMainViewModel : IBaseViewModel
|
||
|
|
{
|
||
|
|
IBaseView View { get; }
|
||
|
|
|
||
|
|
object ContextNavigationRegion { get; set; }
|
||
|
|
object ContextGraphRegion { get; set; }
|
||
|
|
object ContextTestsRegion { get; set; }
|
||
|
|
object ContextGraphsRegion { get; set; }
|
||
|
|
object ContextLegendRegion { get; set; }
|
||
|
|
object ContextDiagRegion { get; set; }
|
||
|
|
object ContextStatsRegion { get; set; }
|
||
|
|
object ContextCursorRegion { get; set; }
|
||
|
|
object ContextPropertyRegion { get; set; }
|
||
|
|
|
||
|
|
List<FrameworkElement> GetRegions();
|
||
|
|
}
|
||
|
|
```
|
||
|
|
The primary shell view model with:
|
||
|
|
- `View`: The main view instance
|
||
|
|
- Nine region context properties for UI composition (all typed as `object`)
|
||
|
|
- `GetRegions()`: Returns a list of all `FrameworkElement` regions
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 3. Invariants
|
||
|
|
|
||
|
|
1. **Inheritance Hierarchy**: All view interfaces must inherit from `IBaseView`. All view model interfaces must inherit from `IBaseViewModel`.
|
||
|
|
|
||
|
|
2. **Region Context Types**: All region context properties in `IMainViewModel` and `IFilterViewModel` are typed as `object`, suggesting late binding or dynamic region assignment.
|
||
|
|
|
||
|
|
3. **Observable Collection Requirement**: `TestSummaryList` uses `ObservableCollection<ITestSummary>`, implying it must support property change notification for UI binding.
|
||
|
|
|
||
|
|
4. **WPF Dependency**: `IMainViewModel.GetRegions()` returns `List<FrameworkElement>`, indicating a hard dependency on WPF presentation elements.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 4. Dependencies
|
||
|
|
|
||
|
|
### External Dependencies (inferred from imports)
|
||
|
|
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base interfaces
|
||
|
|
- `DTS.Common.Interface.TestDefinition` — Provides `ITestSummary` interface
|
||
|
|
- `System.Collections.Generic` — For `List<T>`
|
||
|
|
- `System.Collections.ObjectModel` — For `ObservableCollection<T>`
|
||
|
|
- `System.Windows` — For `FrameworkElement` (WPF)
|
||
|
|
|
||
|
|
### Consumers
|
||
|
|
Unknown from source alone. These interfaces are likely consumed by:
|
||
|
|
- Concrete view implementations (WinForms/WPF user controls)
|
||
|
|
- Concrete view model classes
|
||
|
|
- DI container registrations
|
||
|
|
- Region navigation services
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 5. Gotchas
|
||
|
|
|
||
|
|
1. **File/Interface Name Mismatch**:
|
||
|
|
- File `ITestDefinitionListView.cs` contains interface `ITestSummaryListView`
|
||
|
|
- File `ITestDefinitionListViewModel.cs` contains interface `ITestSummaryListViewModel`
|
||
|
|
|
||
|
|
This naming inconsistency may cause confusion when locating types. The terms "TestDefinition" and "TestSummary" appear to be used interchangeably, which may indicate a historical rename or unclear domain terminology.
|
||
|
|
|
||
|
|
2. **Inconsistent View Property Types**:
|
||
|
|
- `IMenuViewModel.View` returns `IMenuView` (specific type)
|
||
|
|
- `INavigationViewModel.NavigationView` returns `INavigationView` (specific type)
|
||
|
|
- `IFilterViewModel.View` returns `IBaseView` (base type, not `IFilterView`)
|
||
|
|
- `IMainViewModel.View` returns `IBaseView` (base type, not `IMainView`)
|
||
|
|
|
||
|
|
This inconsistency suggests either incomplete refactoring or intentional abstraction at certain levels.
|
||
|
|
|
||
|
|
3. **Suppressed Namespace Check**: `IFilterViewModel.cs` contains `// ReSharper disable CheckNamespace`, indicating possible namespace misalignment that was silenced rather than fixed.
|
||
|
|
|
||
|
|
4. **Region Naming Inconsistency**: `IMainViewModel` has both `ContextGraphRegion` (singular) and `ContextGraphsRegion` (plural). The semantic difference between these is unclear from source alone.
|