133 lines
3.7 KiB
C#
133 lines
3.7 KiB
C#
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");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 43387 Export multiple events: Used to store the <TestSetup>:<TestId>:("<All or ROI>") on a per event basis, for later use by export code
|
|
/// </summary>
|
|
private string _testItem = string.Empty;
|
|
public string TestItem
|
|
{
|
|
get => _testItem;
|
|
set
|
|
{
|
|
_testItem = value;
|
|
OnPropertyChanged("TestItem");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 43387 Export multiple events: Used to store the .DTS file on a per event basis, for later use by export code
|
|
/// </summary>
|
|
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);
|
|
/// <summary>
|
|
/// total time available for download event
|
|
/// </summary>
|
|
public TimeSpan EventLength
|
|
{
|
|
get => _eventLength;
|
|
set
|
|
{
|
|
_eventLength = value; OnPropertyChanged("EventLength");
|
|
}
|
|
}
|
|
|
|
private bool _ShouldDisplayLength = false;
|
|
/// <summary>
|
|
/// whether EventLength should be displayed or not
|
|
/// </summary>
|
|
public bool ShouldDisplayLength
|
|
{
|
|
get => _ShouldDisplayLength;
|
|
set
|
|
{
|
|
_ShouldDisplayLength = value;
|
|
OnPropertyChanged("ShouldDisplayLength");
|
|
}
|
|
}
|
|
}
|
|
}
|