public void ChangeTo(StatisticsInfo info) { Bps.SuspendUpdate(); Pps.SuspendUpdate(); Bps.Add(Tuple.Create(startTime, info.Bps)); Pps.Add(Tuple.Create(startTime, info.Pps)); startTime++; if (Bps.Count > MaxPoints) { Bps.RemoveAt(0); Pps.RemoveAt(0); } Bps.ResumeUpdate(); Pps.ResumeUpdate(); foreach (var key in info.TransportLayer.Keys) { TransportLayer.UpdateOrAdd(key, info.TransportLayer[key]); } foreach (var key in info.ApplicationLayer.Keys) { ApplicationLayer.UpdateOrAdd(key, info.ApplicationLayer[key]); } foreach (var key in info.NetworkLayer.Keys) { NetworkLayer.UpdateOrAdd(key, info.NetworkLayer[key]); } }