42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Text;
|
|
|
|
namespace CordonelPreadjustmentUi.Helper
|
|
{
|
|
public class ActivityCheckMultiPathDataLogContainer<T> : MultiPathDataLogContainer<T>
|
|
{
|
|
private ConcurrentDictionary<Int32, T> PathValueDic = new ConcurrentDictionary<Int32, T>();
|
|
private DateTimeOffset? LastUpdate = null;
|
|
public ActivityCheckMultiPathDataLogContainer(int NumberOfPaths) : base(NumberOfPaths)
|
|
{
|
|
setUpdateTime();
|
|
}
|
|
|
|
|
|
public double GetSecondsSinceLastUpdate()
|
|
{
|
|
if (!LastUpdate.HasValue)
|
|
{
|
|
return -1;
|
|
}
|
|
return (DateTimeOffset.UtcNow - LastUpdate.Value).TotalSeconds;
|
|
}
|
|
|
|
private void setUpdateTime()
|
|
{
|
|
LastUpdate = DateTimeOffset.UtcNow;
|
|
}
|
|
|
|
public new void Update(Int32? Path = null, T value = default(T))
|
|
{
|
|
setUpdateTime();
|
|
base.Update(Path, value);
|
|
}
|
|
|
|
}
|
|
}
|