4.9 KiB
4.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T03:25:06.865522+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 6fb84d209aefd419 |
ChannelCodes
Documentation: Channel Codes Event Definitions
1. Purpose
This module defines Prism-based pub/sub events used to communicate channel code state changes across the application—specifically, when the user switches the view mode for channel codes (ChannelCodesViewChangedEvent) and when one or more channel codes are committed (saved) by the user (ChannelCodeCommittedEvent). These events decouple UI components (e.g., views, viewmodels) that trigger or react to channel code operations, enabling modular and testable interaction without tight coupling.
2. Public Interface
ChannelCodesViewChangedEvent
- Type:
class(inheritsPubSubEvent<DTS.Common.Enums.IsoViewMode>) - Payload:
DTS.Common.Enums.IsoViewMode - Behavior: A singleton event used to notify subscribers when the active view mode for channel codes has changed. The payload indicates the new view mode (e.g.,
IsoViewMode.List,IsoViewMode.Tree). Subscribers should update their UI or internal state accordingly.
ChannelCodeCommittedEvent
- Type:
class(inheritsPubSubEvent<ChannelCodeCommittedEventArgs[]>) - Payload:
ChannelCodeCommittedEventArgs[](array of committed channel codes) - Behavior: A singleton event used to publish one or more channel codes that have been successfully committed (e.g., saved or persisted). Subscribers may refresh caches, update related UI, or audit the action.
ChannelCodeCommittedEventArgs
- Type:
class - Properties:
ChannelCodeType:ChannelEnumsAndConstants.ChannelCodeType— the semantic type of the channel code (e.g.,ChannelCodeType.Network,ChannelCodeType.Service).Code:string— the canonical identifier string for the channel code (e.g.,"NBC").Name:string— the human-readable display name (e.g.,"National Broadcasting Company").CanUserCommitChannelCodes:bool— indicates whether the user who triggered the commit has write privileges for channel codes.
- Behavior: Encapsulates metadata about a single committed channel code. Instances are created and published as part of the
ChannelCodeCommittedEventpayload.
3. Invariants
ChannelCodeCommittedEventArgs.CodeandChannelCodeCommittedEventArgs.Nameare non-null (enforced by constructor; no validation is performed in the class itself, but nulls would likely cause downstream failures).ChannelCodeCommittedEventArgs.ChannelCodeTypemust be a valid member ofChannelEnumsAndConstants.ChannelCodeType(enforced by caller; no runtime check in the class).ChannelCodeCommittedEventpayload is always an array (possibly empty or with one or more elements); no ordering guarantee is specified.CanUserCommitChannelCodesreflects the submitting user’s privileges at the time of commit, not necessarily the current user’s privileges.
4. Dependencies
- Dependencies on other modules:
Prism.Events(external library for event aggregation).DTS.Common.Enums(forIsoViewModeused inChannelCodesViewChangedEvent).DTS.Common.Enums.Channels(forChannelEnumsAndConstants.ChannelCodeTypeused inChannelCodeCommittedEventArgs).
- Depended upon by:
- UI components (e.g., views/viewmodels handling channel code display or editing) that subscribe to these events to synchronize state.
- Likely consumed by modules in
DTS.Commonand higher layers (e.g.,DTS.ClientorDTS.Application) that manage channel code workflows.
5. Gotchas
- Namespace inconsistency:
ChannelCodesViewChangedEventresides inDTS.Common.Events, whileChannelCodeCommittedEventresides inDTS.Common.Events.ChannelCodes. This may cause confusion when discovering or subscribing to events. - No validation in
ChannelCodeCommittedEventArgs: The constructor accepts anystringvalues forCode/Nameand does not enforce non-empty or format constraints. Callers must ensure validity. - Privilege flag is static at commit time:
CanUserCommitChannelCodesis captured at the moment of commit and does not reflect potential privilege changes afterward. Subscribers should treat it as a historical snapshot. - No documentation of
IsoViewModevalues: The meaning of eachIsoViewModeenum member is not included here; refer toDTS.Common.Enums.IsoViewModedefinition. - Array payload may be empty:
ChannelCodeCommittedEventmay be published with an empty array (e.g., in batch operations where no codes were actually modified). Subscribers should handle this case. - None identified from source alone for
ChannelCodesViewChangedEventbeyond namespace inconsistency.