mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
Merge remote-tracking branch 'origin/ConnectPro_v1.8' into ConnectPro_v1.9
This commit is contained in:
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
### Changed
|
### Changed
|
||||||
- Added GetParentUri method to UriExtensions
|
- Added GetParentUri method to UriExtensions
|
||||||
|
|
||||||
|
## [14.1.0] - 2021-01-21
|
||||||
|
### Added
|
||||||
|
- Added overload to GuidUtils that takes an enumerable of guids and combines them into a new deterministic guid
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- A SafeTimer constructor that executes the callback immediately now does this instead of waiting infinitely
|
||||||
|
|
||||||
## [14.0.0] - 2021-01-14
|
## [14.0.0] - 2021-01-14
|
||||||
### Added
|
### Added
|
||||||
- Added Get and Set extensions to PropertyInfo in SIMPLSHARP to mimic overloads avaliable in NETSTANDARD
|
- Added Get and Set extensions to PropertyInfo in SIMPLSHARP to mimic overloads avaliable in NETSTANDARD
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using ICD.Common.Utils.Extensions;
|
||||||
|
|
||||||
namespace ICD.Common.Utils
|
namespace ICD.Common.Utils
|
||||||
{
|
{
|
||||||
@@ -30,5 +32,13 @@ namespace ICD.Common.Utils
|
|||||||
|
|
||||||
return new Guid(aBytes);
|
return new Guid(aBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Combines the guids in the given order to make a new, deterministic guid.
|
||||||
|
/// </summary>
|
||||||
|
public static Guid Combine(IEnumerable<Guid> guids)
|
||||||
|
{
|
||||||
|
return guids.AggregateOrDefault(Combine, default(Guid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ using System.Reflection;
|
|||||||
[assembly: AssemblyCompany("ICD Systems")]
|
[assembly: AssemblyCompany("ICD Systems")]
|
||||||
[assembly: AssemblyProduct("ICD.Common.Utils")]
|
[assembly: AssemblyProduct("ICD.Common.Utils")]
|
||||||
[assembly: AssemblyCopyright("Copyright © ICD Systems 2021")]
|
[assembly: AssemblyCopyright("Copyright © ICD Systems 2021")]
|
||||||
[assembly: AssemblyVersion("14.0.0.0")]
|
[assembly: AssemblyVersion("14.1.0.0")]
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ namespace ICD.Common.Utils.Services.Scheduler
|
|||||||
public ActionSchedulerService()
|
public ActionSchedulerService()
|
||||||
{
|
{
|
||||||
m_Actions = new List<IScheduledAction>();
|
m_Actions = new List<IScheduledAction>();
|
||||||
m_Timer = new SafeTimer(TimerCallback, -1);
|
|
||||||
m_CriticalSection = new SafeCriticalSection();
|
m_CriticalSection = new SafeCriticalSection();
|
||||||
m_LastRunTime = DateTime.MinValue;
|
m_LastRunTime = DateTime.MinValue;
|
||||||
|
m_Timer = SafeTimer.Stopped(TimerCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
@@ -153,15 +153,6 @@ namespace ICD.Common.Utils.Services.Scheduler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Log(eSeverity severity, string message, params object[] args)
|
|
||||||
{
|
|
||||||
ILoggerService logger = ServiceProvider.TryGetService<ILoggerService>();
|
|
||||||
if (logger == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
logger.AddEntry(severity, string.Format("{0} - {1}", this, message), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Log(eSeverity severity, Exception ex, string message, params object[] args)
|
private void Log(eSeverity severity, Exception ex, string message, params object[] args)
|
||||||
{
|
{
|
||||||
ILoggerService logger = ServiceProvider.TryGetService<ILoggerService>();
|
ILoggerService logger = ServiceProvider.TryGetService<ILoggerService>();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace ICD.Common.Utils.Timers
|
|||||||
/// <param name="callback"></param>
|
/// <param name="callback"></param>
|
||||||
/// <param name="repeatPeriod"></param>
|
/// <param name="repeatPeriod"></param>
|
||||||
public SafeTimer(Action callback, long repeatPeriod)
|
public SafeTimer(Action callback, long repeatPeriod)
|
||||||
: this(callback, -1, repeatPeriod)
|
: this(callback, 0, repeatPeriod)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ namespace ICD.Common.Utils.Timers
|
|||||||
if (repeatPeriod < 0 && repeatPeriod != Timeout.Infinite)
|
if (repeatPeriod < 0 && repeatPeriod != Timeout.Infinite)
|
||||||
throw new ArgumentOutOfRangeException("repeatPeriod", "Repeat period must be greater than or equal to 0ms");
|
throw new ArgumentOutOfRangeException("repeatPeriod", "Repeat period must be greater than or equal to 0ms");
|
||||||
|
|
||||||
if (dueTime >= int.MaxValue)
|
if (repeatPeriod >= int.MaxValue)
|
||||||
throw new ArgumentOutOfRangeException("repeatPeriod", string.Format("Repeat period must be less than {0:n0}ms", int.MaxValue));
|
throw new ArgumentOutOfRangeException("repeatPeriod", string.Format("Repeat period must be less than {0:n0}ms", int.MaxValue));
|
||||||
|
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
|
|||||||
Reference in New Issue
Block a user