using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.Device { public class DeviceStatus { public ConcurrentDictionary status = new ConcurrentDictionary(); public void Update(string key, object value) { status.AddOrUpdate(key, value, (key, value) => value); } public Dictionary GetStatus() { return status.ToDictionary(x => x.Key, x => x.Value); } } }