Files

112 lines
5.5 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressBarView.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressFooterView.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressBarFooterViewModel.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/IStatusAndProgressBarViewModel.cs
- Common/DTS.CommonCore/Interface/StatusAndProgressBar/StatusAndProgressDelegates.cs
generated_at: "2026-04-16T12:18:12.505284+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "329090afc20c7c34"
---
# Documentation: DTS.Common.Interface.StatusAndProgressBar
## 1. Purpose
This module defines the contract layer for status and progress bar UI components within the DTS application. It provides interfaces for views and view models following a Model-View-ViewModel (MVVM) pattern, along with a set of delegate types used for progress reporting, status updates, and error handling callbacks. The module serves as an abstraction layer that decouples UI implementation from business logic, enabling consistent progress tracking and status communication across the application.
---
## 2. Public Interface
### Interfaces
#### `IStatusAndProgressBarView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
An empty marker interface extending `IBaseView`. No members defined.
---
#### `IStatusAndProgressFooterView`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseView`
An empty marker interface extending `IBaseView`. No members defined.
---
#### `IStatusAndProgressBarFooterViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
| Property | Type | Accessor | Description |
|----------|------|----------|-------------|
| `View` | `IStatusAndProgressFooterView` | get; set; | Holds reference to the associated footer view |
---
#### `IStatusAndProgressBarViewModel`
**Namespace:** `DTS.Common.Interface`
**Inheritance:** `IBaseViewModel`
| Property | Type | Accessor | Description |
|----------|------|----------|-------------|
| `View` | `IBaseView` | get; set; | Gets the Search View (per XML comment) |
| `Parent` | `IBaseViewModel` | get; set; | Reference to parent view model |
| `ProgressBarName` | `string` | get; set; | Name identifier for the progress bar |
| `ContextSearchRegion` | `object` | get; set; | Context object for search region (purpose unclear from source) |
---
### Delegates
**Namespace:** `DTS.Common.Interface.StatusAndProgressBar`
| Delegate | Signature | Description |
|----------|-----------|-------------|
| `SetProgressValueDelegate` | `void (double value)` | Callback for setting a progress bar value |
| `SetStatusTextDelegate` | `void (string text)` | Callback for setting status text |
| `SetProgressVisibilityDelegate` | `void (bool bVisible)` | Callback for toggling progress bar visibility |
| `SetStatusColorDelegate` | `void (Color color)` | Callback for setting status color |
| `ActionCompleteDelegate` | `void ()` | Callback signaling action completion |
| `StatusIntDelegate` | `void (int status)` | Callback for reporting integer status |
| `StatusExIntDelegate` | `void (int status, params object[] extra)` | Callback for reporting integer status with additional parameters |
| `ErrorCallback` | `DialogResult (string errorString, string unit)` | Callback for error handling that returns a dialog result |
---
## 3. Invariants
- All view interfaces (`IStatusAndProgressBarView`, `IStatusAndProgressFooterView`) must inherit from `IBaseView`.
- All view model interfaces (`IStatusAndProgressBarFooterViewModel`, `IStatusAndProgressBarViewModel`) must inherit from `IBaseViewModel`.
- `IStatusAndProgressBarFooterViewModel.View` must be assignable to `IStatusAndProgressFooterView`, not just `IBaseView`.
- The `SetStatusColorDelegate` uses `System.Windows.Media.Color` (WPF color type), not `System.Drawing.Color`.
- The `ErrorCallback` delegate returns `System.Windows.Forms.DialogResult`, indicating Windows Forms interop.
---
## 4. Dependencies
### This module depends on:
- **`DTS.Common.Base`** - Provides `IBaseView` and `IBaseViewModel` base interfaces
- **`System.Windows.Forms`** - Provides `DialogResult` enum used in `ErrorCallback`
- **`System.Windows.Media`** - Provides `Color` struct used in `SetStatusColorDelegate`
### What depends on this module:
- Cannot be determined from source alone. Implementations of these interfaces would exist elsewhere in the codebase.
---
## 5. Gotchas
1. **Mixed UI Framework References:** The delegates reference both `System.Windows.Media.Color` (WPF) and `System.Windows.Forms.DialogResult` (WinForms). This suggests either hybrid UI usage or legacy interop. Developers should be aware of the correct `Color` type when implementing `SetStatusColorDelegate`.
2. **Misleading XML Comment:** The `View` property in `IStatusAndProgressBarViewModel` has an XML comment stating "Gets the Search View", which appears unrelated to the interface's purpose (status/progress bar). This may be a copy-paste error from another interface.
3. **Empty Marker Interfaces:** Both `IStatusAndProgressBarView` and `IStatusAndProgressFooterView` define no members beyond their base interface. Their purpose as separate types (rather than using `IBaseView` directly) is unclear from source alone—possibly for DI container registration or type discrimination.
4. **Vague `ContextSearchRegion` Property:** The purpose and expected type of `ContextSearchRegion` (typed as `object`) is not documented. Its relationship to "Search" in a progress bar context is unclear from source alone.