mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
Merge branch 'feat/init-event' into MetLife_v5.4.2
# Conflicts: # CHANGELOG.md
This commit is contained in:
@@ -5,11 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [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
|
||||||
|
|
||||||
|
|
||||||
|
## [8.4.1] - 2019-06-05
|
||||||
|
### Added
|
||||||
|
- Adding features to IcdEnvironment for tracking program initialization state
|
||||||
|
|
||||||
## [8.4.0] - 2019-05-15
|
## [8.4.0] - 2019-05-15
|
||||||
### Added
|
### Added
|
||||||
- Added GUID utils for generating seeded GUIDs
|
- Added GUID utils for generating seeded GUIDs
|
||||||
|
|||||||
@@ -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