init
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
---
|
||||
source_files:
|
||||
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsView.cs
|
||||
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsExportView.cs
|
||||
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsImportView.cs
|
||||
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelModel.cs
|
||||
- Common/DTS.CommonCore/Interface/CustomChannels/ICustomChannelsViewModel.cs
|
||||
generated_at: "2026-04-16T12:10:34.879323+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "d441dada7c96f903"
|
||||
---
|
||||
|
||||
# Custom Channels Interface Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module defines the contract interfaces for a Custom Channels feature, implementing a Model-View-ViewModel (MVVM) architecture. It provides abstractions for managing custom channel configurations, including the ability to import and export channel definitions. The interfaces decouple the presentation layer from business logic, enabling view models to orchestrate import/export operations while views remain passive implementations of `IBaseView` and `IBaseViewModel` contracts.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `ICustomChannelsView`
|
||||
**Namespace:** `DTS.Common.Interface`
|
||||
**Inheritance:** `IBaseView`
|
||||
|
||||
A marker interface with no members. Identifies views responsible for displaying custom channels.
|
||||
|
||||
---
|
||||
|
||||
### `ICustomChannelsExportView`
|
||||
**Namespace:** `DTS.Common.Interface.CustomChannels`
|
||||
**Inheritance:** `IBaseView`
|
||||
|
||||
A marker interface with no members. Identifies views handling the export workflow for custom channels.
|
||||
|
||||
---
|
||||
|
||||
### `ICustomChannelsImportView`
|
||||
**Namespace:** `DTS.Common.Interface.CustomChannels`
|
||||
**Inheritance:** `IBaseView`
|
||||
|
||||
A marker interface with no members. Identifies views handling the import workflow for custom channels.
|
||||
|
||||
---
|
||||
|
||||
### `ICustomChannelModel`
|
||||
**Namespace:** `DTS.Common.Interface.CustomChannels`
|
||||
|
||||
Represents a single custom channel item with selection state.
|
||||
|
||||
| Property | Type | Access | Description |
|
||||
|----------|------|--------|-------------|
|
||||
| `Name` | `string` | get | The identifier or display name of the custom channel. |
|
||||
| `Included` | `bool` | get, set | Indicates whether this channel is selected for an operation (e.g., export). |
|
||||
|
||||
---
|
||||
|
||||
### `ICustomChannelsViewModel`
|
||||
**Namespace:** `DTS.Common.Interface.CustomChannels`
|
||||
**Inheritance:** `IBaseViewModel`
|
||||
|
||||
Orchestrates custom channel import/export operations.
|
||||
|
||||
**Properties:**
|
||||
|
||||
| Property | Type | Access | Description |
|
||||
|----------|------|--------|-------------|
|
||||
| `ImportView` | `ICustomChannelsImportView` | get, set | The view instance for import operations. |
|
||||
| `ExportView` | `ICustomChannelsExportView` | get, set | The view instance for export operations. |
|
||||
| `ExportFileName` | `string` | get, set | Target file path for export operations. |
|
||||
| `ImportFileName` | `string` | get, set | Source file path for import operations. |
|
||||
| `AllCustomChannels` | `ObservableCollection<ICustomChannelModel>` | get | Collection of all available custom channel models. |
|
||||
|
||||
**Methods:**
|
||||
|
||||
| Method | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `Unset` | `void Unset()` | Clears or resets the view model state. |
|
||||
| `OnSetActive` | `void OnSetActive(bool bImport)` | Called when the view becomes active; `bImport` indicates import mode (true) vs export mode (false). |
|
||||
| `ReadImportFile` | `void ReadImportFile()` | Reads and parses the file specified by `ImportFileName`. |
|
||||
| `SelectAll` | `void SelectAll()` | Sets `Included` to `true` for all items in `AllCustomChannels`. |
|
||||
| `ClearSelection` | `void ClearSelection()` | Sets `Included` to `false` for all items in `AllCustomChannels`. |
|
||||
| `Export` | `void Export()` | Executes the export operation using current selection and `ExportFileName`. |
|
||||
| `Import` | `void Import()` | Executes the import operation using current selection and `ImportFileName`. |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- `ICustomChannelModel.Name` is read-only; once set by the implementation, the name cannot be changed through this interface.
|
||||
- `AllCustomChannels` is read-only at the interface level; consumers cannot replace the collection, only modify its contents or item properties.
|
||||
- All view interfaces (`ICustomChannelsView`, `ICustomChannelsExportView`, `ICustomChannelsImportView`) must be assignable to `IBaseView`.
|
||||
- `ICustomChannelsViewModel` must be assignable to `IBaseViewModel`.
|
||||
- The `bImport` parameter in `OnSetActive` uses a boolean to distinguish between import (true) and export (false) modes.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
**This module depends on:**
|
||||
- `DTS.Common.Base` — Provides `IBaseView` and `IBaseViewModel` base contracts.
|
||||
- `System.Collections.ObjectModel` — Provides `ObservableCollection<T>` used for `AllCustomChannels`.
|
||||
|
||||
**What depends on this module:**
|
||||
- Cannot be determined from source alone. Concrete implementations of these interfaces, as well as consumers of `ICustomChannelsViewModel`, would exist elsewhere in the codebase.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Namespace inconsistency:** `ICustomChannelsView` resides in `DTS.Common.Interface`, while all other interfaces in this feature set reside in `DTS.Common.Interface.CustomChannels`. This may cause confusion or require additional using directives.
|
||||
|
||||
2. **Marker interfaces:** `ICustomChannelsView`, `ICustomChannelsExportView`, and `ICustomChannelsImportView` define no members. Their utility appears to be type identification for view resolution or dependency injection—verify the actual usage pattern in the consuming codebase.
|
||||
|
||||
3. **Import/Export coupling:** The `ICustomChannelsViewModel` manages both import and export workflows. The `OnSetActive(bool bImport)` method toggles behavior based on a boolean flag, which may complicate testing or extension if the two workflows diverge.
|
||||
|
||||
4. **File I/O abstraction:** The interfaces expose file names as strings (`ImportFileName`, `ExportFileName`) with no validation hints. It is unclear whether implementations validate file existence, extensions, or permissions before `ReadImportFile()`, `Export()`, or `Import()` are called.
|
||||
Reference in New Issue
Block a user