mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
feat: Added an event that is raised when the system time is set
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#if SIMPLSHARP
|
using ICD.Common.Utils.Extensions;
|
||||||
|
#if SIMPLSHARP
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
@@ -198,6 +199,8 @@ namespace ICD.Common.Utils
|
|||||||
(ushort)localTime.Month,
|
(ushort)localTime.Month,
|
||||||
(ushort)localTime.Day,
|
(ushort)localTime.Day,
|
||||||
(ushort)localTime.Year);
|
(ushort)localTime.Year);
|
||||||
|
|
||||||
|
OnSystemDateTimeChanged.Raise(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static eEthernetEventType GetEthernetEventType(Crestron.SimplSharp.eEthernetEventType type)
|
public static eEthernetEventType GetEthernetEventType(Crestron.SimplSharp.eEthernetEventType type)
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ namespace ICD.Common.Utils
|
|||||||
localTime.ToString("s"));
|
localTime.ToString("s"));
|
||||||
#else
|
#else
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
|
||||||
|
OnSystemDateTimeChanged.Raise(null);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,11 @@ namespace ICD.Common.Utils
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static event EventHandler OnProgramInitializationComplete;
|
public static event EventHandler OnProgramInitializationComplete;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when the system date/time has been set.
|
||||||
|
/// </summary>
|
||||||
|
public static event EventHandler OnSystemDateTimeChanged;
|
||||||
|
|
||||||
private static readonly SafeCriticalSection s_ProgramInitializationSection = new SafeCriticalSection();
|
private static readonly SafeCriticalSection s_ProgramInitializationSection = new SafeCriticalSection();
|
||||||
private static bool s_ProgramInitializationComplete;
|
private static bool s_ProgramInitializationComplete;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user