using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MotoTRBO_SOC { public class UnitsMonitoring { //private MemoryCache mem = new MemoryCache("UnitsMonitoring"); public UnitsMonitoring() { } /// /// Method which will gestion the presence notification for units /// /// Value indicating if the units is present or not /// The unit id which changed it's status public void OnARSReceived(bool isOn, string radioID) { /* // remove the if (!isOn) mem.Remove(radioID); else { if (mem.Contains(radioID)) ; else { UnitStat unitStat = new UnitStat() { }; CacheItemPolicy itemPoliciy = new CacheItemPolicy() { AbsoluteExpiration = DateTime.UtcNow.AddSeconds(unitStat.ReportingInterval * 2) }; itemPoliciy.RemovedCallback += new CacheEntryRemovedCallback(delegate(CacheEntryRemovedArguments arg) { arg.RemovedReason == CacheEntryRemovedReason. }); mem.Add(radioID + "", unitStat, itemPoliciy); } } */ } } public class UnitStat { public DateTime ARSTime; public DateTime LastReportingTime; public int NumberOfPositions; public int ReportingInterval; public UnitStat() { ARSTime = DateTime.Now; LastReportingTime = DateTime.Now; NumberOfPositions = 0; ReportingInterval = 300; } } }