4.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T02:20:00.100876+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 089f2c1bff740fce |
DownloadEvent
Purpose
This module defines the IDownloadEvent interface, which represents a single download event in a multiple-download system. It serves as a contract for objects that model downloadable content units (e.g., media segments, files, or tasks), exposing metadata and state necessary for UI binding and orchestration—such as identification, enablement status, defaultness, and duration—while supporting data binding via INotifyPropertyChanged.
Public Interface
-
int EventNumber { get; set; }
Gets or sets a numeric identifier for the download event. Used for ordering or referencing the event programmatically. -
string EventNumberDisplay { get; set; }
Gets or sets a user-facing string representation of the event number (e.g.,"1","A","001"), allowing formatting distinct fromEventNumber. -
bool IsEnabled { get; set; }
Gets or sets whether the event is active and可 downloaded. Whenfalse, the event should be skipped or ignored during download operations. -
bool IsReadonly { get; set; }
Gets or sets whether the event’s properties (e.g.,EventNumber,IsEnabled) are immutable in the UI or via programmatic modification. Atruevalue indicates the event is locked for editing. -
bool IsDefault { get; }
Gets a read-only flag indicating whether this event is the default selection (e.g., pre-selected for download). Cannot be set—implementation-determined. -
TimeSpan EventLength { get; set; }
Gets or sets the total duration of the downloadable content for this event (e.g., video/audio length). Represents available content length, not necessarily downloaded. -
bool ShouldDisplayLength { get; set; }
Gets or sets whether theEventLengthshould be rendered in the UI. Allows conditional visibility of duration (e.g., hide for non-time-based downloads).
All properties raise PropertyChanged notifications via INotifyPropertyChanged when modified (as required by the interface inheritance).
Invariants
IsDefaultis read-only (getonly); its value must be determined and fixed by the implementing type and cannot be altered externally.EventLengthrepresents available content duration, not actual downloaded bytes or progress—its semantics are temporal, not volumetric.IsReadonlyandIsEnabledmay be set independently, but UI behavior should ensureIsReadonly = trueimpliesIsEnabledcannot be toggled by user action (though programmatic changes remain possible).EventNumberDisplayis not required to matchEventNumber.ToString(); implementations may format it arbitrarily (e.g., localized, padded, or symbolic).
Dependencies
- Depends on:
System(core types likeTimeSpan,EventHandler)System.ComponentModel(INotifyPropertyChanged)
- Depended on by:
- UI layers (e.g., WPF/WinForms view models) that bind to download event lists
- Download orchestration logic that filters or prioritizes events based on
IsEnabled,IsDefault, orEventNumber - Serialization/deserialization logic (e.g., for persisting download configurations)
No other internal module dependencies are visible in this file.
Gotchas
EventLengthis named descriptively as “total length available for download event” in XML doc, but the property itself does not distinguish between total available vs. downloaded—consumers must infer semantics from naming and context.IsDefaultis read-only but has no documentation on how it is determined (e.g., by position, metadata, or configuration). Its behavior is implementation-specific.ShouldDisplayLengthis a UI hint only; it does not affectEventLength’s value or behavior in non-UI logic. Misusing it as a data filter may cause inconsistencies.- No validation rules are enforced by the interface (e.g.,
EventNumbermay be negative;EventLengthmay beTimeSpan.Zeroor negative unless guarded by implementation). - The file header comment
//FB 6399suggests a feature/bug reference, but no context is provided—this may be relevant for historical debugging.
None identified beyond the above.