mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
Merge remote-tracking branch 'origin/ConnectPro_v1.1' into ConnectPro_v1.2
# Conflicts: # CHANGELOG.md # ICD.Common.Utils/Properties/AssemblyInfo.cs
This commit is contained in:
@@ -67,6 +67,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
- Better VC-4 support for IcdConsole
|
- Better VC-4 support for IcdConsole
|
||||||
- JSON refactoring for simpler deserialization
|
- JSON refactoring for simpler deserialization
|
||||||
|
|
||||||
|
## [8.5.0] - 2019-06-06
|
||||||
|
### Added
|
||||||
|
- Adding features to IcdEnvironment for tracking program initialization state
|
||||||
|
|
||||||
## [8.4.1] - 2019-06-05
|
## [8.4.1] - 2019-06-05
|
||||||
### Changed
|
### Changed
|
||||||
- Caching the program/processor start time and calculating the uptime from those values instead of polling the crestron processor
|
- Caching the program/processor start time and calculating the uptime from those values instead of polling the crestron processor
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using ICD.Common.Properties;
|
||||||
|
using ICD.Common.Utils.Extensions;
|
||||||
|
|
||||||
namespace ICD.Common.Utils
|
namespace ICD.Common.Utils
|
||||||
{
|
{
|
||||||
@@ -54,5 +56,41 @@ namespace ICD.Common.Utils
|
|||||||
public static event ProgramStatusCallback OnProgramStatusEvent;
|
public static event ProgramStatusCallback OnProgramStatusEvent;
|
||||||
|
|
||||||
public static event EthernetEventCallback OnEthernetEvent;
|
public static event EthernetEventCallback OnEthernetEvent;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised when the program has completed initialization.
|
||||||
|
/// </summary>
|
||||||
|
public static event EventHandler OnProgramInitializationComplete;
|
||||||
|
|
||||||
|
private static readonly SafeCriticalSection s_ProgramInitializationSection = new SafeCriticalSection();
|
||||||
|
private static bool s_ProgramInitializationComplete;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if the program has been flagged as completely initialized.
|
||||||
|
/// </summary>
|
||||||
|
public static bool ProgramIsInitialized { get { return s_ProgramInitializationSection.Execute(() => s_ProgramInitializationComplete); } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called by the program entry point to signify that the program initialization is complete.
|
||||||
|
/// </summary>
|
||||||
|
[PublicAPI]
|
||||||
|
public static void SetProgramInitializationComplete()
|
||||||
|
{
|
||||||
|
s_ProgramInitializationSection.Enter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (s_ProgramInitializationComplete)
|
||||||
|
return;
|
||||||
|
|
||||||
|
s_ProgramInitializationComplete = true;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
s_ProgramInitializationSection.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
|
OnProgramInitializationComplete.Raise(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user