5.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T12:10:34.879323+00:00 | zai-org/GLM-5-FP8 | 1 | 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.Nameis read-only; once set by the implementation, the name cannot be changed through this interface.AllCustomChannelsis 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 toIBaseView. ICustomChannelsViewModelmust be assignable toIBaseViewModel.- The
bImportparameter inOnSetActiveuses a boolean to distinguish between import (true) and export (false) modes.
4. Dependencies
This module depends on:
DTS.Common.Base— ProvidesIBaseViewandIBaseViewModelbase contracts.System.Collections.ObjectModel— ProvidesObservableCollection<T>used forAllCustomChannels.
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
-
Namespace inconsistency:
ICustomChannelsViewresides inDTS.Common.Interface, while all other interfaces in this feature set reside inDTS.Common.Interface.CustomChannels. This may cause confusion or require additional using directives. -
Marker interfaces:
ICustomChannelsView,ICustomChannelsExportView, andICustomChannelsImportViewdefine no members. Their utility appears to be type identification for view resolution or dependency injection—verify the actual usage pattern in the consuming codebase. -
Import/Export coupling: The
ICustomChannelsViewModelmanages both import and export workflows. TheOnSetActive(bool bImport)method toggles behavior based on a boolean flag, which may complicate testing or extension if the two workflows diverge. -
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 beforeReadImportFile(),Export(), orImport()are called.