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 : MultiPathDataLogContainer { private ConcurrentDictionary PathValueDic = new ConcurrentDictionary(); 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); } } }