feat: Added an event that is raised when the system time is set

This commit is contained in:
Chris Cameron
2019-09-10 17:17:09 -04:00
parent 0821dcb3ca
commit 83bc344ab3
3 changed files with 11 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
#if SIMPLSHARP
using ICD.Common.Utils.Extensions;
#if SIMPLSHARP
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
@@ -198,6 +199,8 @@ namespace ICD.Common.Utils
(ushort)localTime.Month,
(ushort)localTime.Day,
(ushort)localTime.Year);
OnSystemDateTimeChanged.Raise(null);
}
public static eEthernetEventType GetEthernetEventType(Crestron.SimplSharp.eEthernetEventType type)

View File

@@ -86,6 +86,8 @@ namespace ICD.Common.Utils
localTime.ToString("s"));
#else
throw new NotSupportedException();
OnSystemDateTimeChanged.Raise(null);
#endif
}

View File

@@ -62,6 +62,11 @@ namespace ICD.Common.Utils
/// </summary>
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 bool s_ProgramInitializationComplete;