Files
GPW/GPW.CORE.UI/Data/SharedService.cs
T
2022-01-17 12:40:59 +01:00

66 lines
1.6 KiB
C#

using GPW.CORE.Data;
namespace GPW.CORE.UI.Data
{
/// <summary>
/// Servizi e dati condivisi a livello applicazione
/// </summary>
public class SharedService
{
#region Private Fields
private List<LiManObj.AttivazioneDTO> _activList = new List<LiManObj.AttivazioneDTO>();
#endregion Private Fields
#region Public Events
public event Action EA_InfoUpdated = null!;
#endregion Public Events
#region Public Properties
public List<LiManObj.AttivazioneDTO> ActivList
{
get => _activList;
set
{
if (_activList != value)
{
_activList = value;
if (EA_InfoUpdated != null)
{
EA_InfoUpdated?.Invoke();
}
}
}
}
public string Installazione { get; set; } = "";
public string Applicazione { get; set; } = "";
public string MasterKey { get; set; } = "";
public bool ValidData
{
get => !string.IsNullOrEmpty(Installazione) && !string.IsNullOrEmpty(Applicazione) && !string.IsNullOrEmpty(MasterKey) && ActivList != null && ActivList.Count > 0;
}
public DateTime infoExpiry { get; set; } = DateTime.Today.AddDays(1);
#endregion Public Properties
#region Private Methods
private void ReportUpdated()
{
if (EA_InfoUpdated != null)
{
EA_InfoUpdated?.Invoke();
}
}
#endregion Private Methods
}
}