Files
2026-04-17 14:55:32 -04:00

84 lines
3.6 KiB
Markdown

---
source_files:
- Common/DTS.Common/Interface/Channels/ChannelCodes/IChannelCodesListView.cs
- Common/DTS.Common/Interface/Channels/ChannelCodes/IChannelCodesListViewModel.cs
- Common/DTS.Common/Interface/Channels/ChannelCodes/IChannelCode.cs
generated_at: "2026-04-17T16:35:56.589507+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "71241a25844594e0"
---
# Documentation: Channel Codes Module
## 1. Purpose
This module defines the contract for a channel code management UI component within the DTS system. It provides interfaces for a View/ViewModel pattern that handles the display, editing, validation, and organization of two categories of channel codes: ISO channel codes and User-defined channel codes. The module abstracts the UI behavior for channel code lists, supporting operations such as filtering, sorting, copying, deleting, and bulk pasting of code data.
---
## 2. Public Interface
### `IChannelCodesListView`
**Namespace:** `DTS.Common.Interface.Channels.ChannelCodes`
**Signature:**
```csharp
public interface IChannelCodesListView : IBaseView { }
```
A marker interface extending `IBaseView` with no additional members. Represents the view contract for the channel codes list UI.
---
### `IChannelCodesListViewModel`
**Namespace:** `DTS.Common.Interface.Channels.ChannelCodes`
**Signature:**
```csharp
public interface IChannelCodesListViewModel : IBaseViewModel
```
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `View` | `IChannelCodesListView` | Gets or sets the associated view instance. |
| `ISOChannelCodes` | `ObservableCollection<IChannelCode>` | Collection of ISO channel codes displayed in the UI. |
| `UserChannelCodes` | `ObservableCollection<IChannelCode>` | Collection of user-defined channel codes displayed in the UI. |
| `ChannelCodesFunc` | `Func<IList<IChannelCode>>` | Function delegate that returns a list of channel codes. |
| `ShowISOStringBuilder` | `bool` | Controls visibility of the ISO string builder UI element. |
| `UniqueISOCodesRequired` | `bool` | Indicates whether ISO codes must be unique. |
| `ShowChannelCodeLookupHelper` | `bool` | Controls visibility of the channel code lookup helper UI element. |
| `IsReadOnly` | `bool` | Controls whether the UI is in read-only mode. |
| `SelectedCodes` | `IChannelCode[]` | Returns an array of currently selected channel codes. |
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `Unset` | `void Unset()` | Clears or resets the view model state. |
| `SetPage` | `void SetPage(object page)` | Sets the current page context. |
| `OnSetActive` | `void OnSetActive()` | Called when the view becomes active. |
| `Save` | `bool Save()` | Persists changes. Returns success status. |
| `Validate` | `bool Validate(bool bDisplayWindow)` | Validates the current state. Parameter controls whether validation errors are displayed in a UI window. |
| `CopySelected` | `void CopySelected()` | Copies the currently selected channel codes. |
| `DeleteSelected` | `void DeleteSelected()` | Deletes the currently selected channel codes. |
| `Filter` | `void Filter(object columnTag, string searchTerm)` | Filters the displayed channel codes based on a column and search term. |
| `Sort` | `void Sort(object columnTag, bool bColumnClick)` | Sorts the displayed channel codes by the specified column. |
---
### `IChannelCode`
**Namespace:** `DTS.Common.Interface.Channels.ChannelCodes`
**Signature:**
```csharp
public interface IChannelCode
```
Represents a single channel code item for UI display and manipulation.
**Properties:**
| Property |