Aggiunta classe servizio dati shared
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user