--- source_files: - Common/DTS.CommonCore/Interface/DownloadEvent/IDownloadEvent.cs generated_at: "2026-04-16T12:13:29.485943+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "089f2c1bff740fce" --- # Documentation: IDownloadEvent.cs ## 1. Purpose This module defines the `IDownloadEvent` interface within the `DTS.Common.Interface.DownloadEvent` namespace. It serves as a data contract for representing a "Multiple download event" (as noted in source comments). The interface is designed for UI data-binding scenarios, indicated by its inheritance from `INotifyPropertyChanged`, and encapsulates properties regarding an event's identification, interactive state (enabled/readonly), duration, and display logic. ## 2. Public Interface ### Interface: `IDownloadEvent` Inherits from: `INotifyPropertyChanged` **Properties:** * `int EventNumber { get; set; }` * Gets or sets the numeric identifier for the download event. * `string EventNumberDisplay { get; set; }` * Gets or sets the string representation of the event number, intended for UI display purposes. * `bool IsEnabled { get; set; }` * Gets or sets a value indicating whether the download event is enabled. * `bool IsReadonly { get; set; }` * Gets or sets a value indicating whether the download event is read-only. * `bool IsDefault { get; }` * Gets a value indicating whether this instance is the default event. This property is read-only (has no setter). * `TimeSpan EventLength { get; set; }` * Gets or sets the total length available for the download event. * `bool ShouldDisplayLength { get; set; }` * Gets or sets a value indicating whether the event length should be displayed in the UI. ## 3. Invariants * **INotifyPropertyChanged Contract:** Any class implementing `IDownloadEvent` must implement the `PropertyChanged` event from `INotifyPropertyChanged`. Implementations are expected to raise this event when property values change to support UI binding. * **Read-Only State:** The `IsDefault` property is strictly read-only. Implementations must calculate or determine this state internally; it cannot be set externally via the interface. ## 4. Dependencies * **System**: Required for the `TimeSpan` type. * **System.ComponentModel**: Required for the `INotifyPropertyChanged` interface. * **Consumers**: Unknown from this source file alone, though the namespace `DTS.Common.Interface.DownloadEvent` suggests it is consumed by UI components or ViewModels handling download logic within the DTS system. ## 5. Gotchas * **Dual Event Number Properties:** The interface defines both `EventNumber` (int) and `EventNumberDisplay` (string). The source does not define the relationship between them (e.g., if setting one automatically updates the other). Developers should verify the synchronization logic in the concrete implementation. * **IsDefault Logic:** Because `IsDefault` has no setter, the logic determining what makes an event "default" is encapsulated within the implementation. Developers cannot force an event to be default via this interface. * **Comment Reference:** The comment `//FB 6399` references a specific issue tracking ID (likely FogBugz), suggesting this interface was created to address a specific requirement or bug regarding "Multiple download events."