using System; using System.Collections.Generic; using System.ComponentModel; using DTS.Common.Interface.DownloadEvent; namespace DataPROWin7.DataModel { [Serializable] public class DownloadEvent : IDownloadEvent { public DownloadEvent() { EventNumber = 0; IsEnabled = true; IsDefault = true; IsReadonly = true; } public DownloadEvent(bool isDefault = false) : this() { IsDefault = isDefault; } public DownloadEvent(int eventNumber = 0, bool isDefault = false) : this(isDefault) { EventNumber = eventNumber; } private int _eventNumber = 0; public int EventNumber { get => _eventNumber; set { _eventNumber = value; OnPropertyChanged("EventNumber"); EventNumberDisplay = $"{DTS.Common.Constants.EventNumber} {_eventNumber:00}"; } } private bool _isEnabled = true; public bool IsEnabled { get => _isEnabled; set { _isEnabled = value; OnPropertyChanged("IsEnabled"); } } public bool IsDefault { get; } private string _eventNumberDisplay = string.Empty; public string EventNumberDisplay { get => _eventNumberDisplay; set { _eventNumberDisplay = value; OnPropertyChanged("EventNumberDisplay"); } } /// /// 43387 Export multiple events: Used to store the ::("") on a per event basis, for later use by export code /// private string _testItem = string.Empty; public string TestItem { get => _testItem; set { _testItem = value; OnPropertyChanged("TestItem"); } } /// /// 43387 Export multiple events: Used to store the .DTS file on a per event basis, for later use by export code /// private string _dtsFile = string.Empty; public string DTSFile { get => _dtsFile; set { _dtsFile = value; OnPropertyChanged("DTSFile"); } } private bool _isReadonly = true; public bool IsReadonly { get => _isReadonly; set { _isReadonly = value; OnPropertyChanged("IsReadonly"); } } public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } private TimeSpan _eventLength = new TimeSpan(0); /// /// total time available for download event /// public TimeSpan EventLength { get => _eventLength; set { _eventLength = value; OnPropertyChanged("EventLength"); } } private bool _ShouldDisplayLength = false; /// /// whether EventLength should be displayed or not /// public bool ShouldDisplayLength { get => _ShouldDisplayLength; set { _ShouldDisplayLength = value; OnPropertyChanged("ShouldDisplayLength"); } } } }