This module defines the core interfaces for a Custom Channels feature, enabling users to manage user-defined channel configurations through import/export workflows. It provides a separation of concerns between view layers (ICustomChannelsView, ICustomChannelsImportView, ICustomChannelsExportView), data models (ICustomChannelModel), and view-model logic (ICustomChannelsViewModel). The module serves as the contract layer for a UI-driven workflow where users can select, import from files, export to files, and toggle inclusion status of custom channels—likely in a data acquisition, signal processing, or configuration context.
2. Public Interface
Interfaces
ICustomChannelsView Namespace:DTS.Common.Interface Inherits:IBaseView Description: Marker interface for the main custom channels view. No additional members beyond base view contract.
ICustomChannelsExportView Namespace:DTS.Common.Interface.CustomChannels Inherits:IBaseView Description: Marker interface for the export-specific view component.
ICustomChannelsImportView Namespace:DTS.Common.Interface.CustomChannels Inherits:IBaseView Description: Marker interface for the import-specific view component.
ObservableCollection<ICustomChannelModel> AllCustomChannels { get; } — Collection of all available custom channel models; bound to UI for selection. Methods:
void Unset() — Likely clears references or resets state (e.g., view bindings).
void OnSetActive(bool bImport) — Activates the view for either import (bImport == true) or export (bImport == false) mode.
void ReadImportFile() — Reads and parses the file specified in ImportFileName, populating AllCustomChannels.
void SelectAll() — Sets Included = true for all items in AllCustomChannels.
void ClearSelection() — Sets Included = false for all items in AllCustomChannels.
void Export() — Executes export of selected (included) channels to ExportFileName.
void Import() — Executes import of selected (included) channels from ImportFileName.
3. Invariants
AllCustomChannels is an ObservableCollection<ICustomChannelModel>—UI must be notified of changes via collection change events.
Included property on each ICustomChannelModel is mutable and controls inclusion state for import/export operations.
ImportFileName and ExportFileName must be set before calling ReadImportFile(), Import(), or Export(); otherwise, behavior is undefined.
OnSetActive(bool) must be called to switch between import/export modes before invoking import/export operations.
Unset() is expected to be called during view lifecycle teardown (e.g., view disposal), though exact semantics are not specified beyond resetting state.
View-model implementations (e.g., concrete ICustomChannelsViewModel classes) that consume file I/O, channel parsing, and export logic.
Likely used by a higher-level controller or shell module that orchestrates custom channel workflows.
5. Gotchas
No file format specification: The interfaces do not define the expected format for import/export files—implementation details (e.g., CSV, XML, JSON) are not visible here.
Ambiguous ReadImportFile() semantics: Does it replaceAllCustomChannels, append, or merge? The interface does not clarify.
No error handling in interface: Methods like Import(), Export(), and ReadImportFile() have no declared exception behavior—consumers must infer or document error paths separately.
Unset() is underspecified: Its purpose (e.g., nulling view references, clearing collections) is not defined.
No validation on Name or Included: No constraints on Name (e.g., null/empty rules) or Included default value are specified.
No thread-safety guarantees: ObservableCollection<T> is not thread-safe; concurrent access (e.g., async import) may require synchronization.
None identified from source alone for file I/O behavior, error handling, and lifecycle management—these require implementation context.