public void AddNew(List<TableObject> ObjectList) { lock (_lockCointainers) { HistoryContainer c = new HistoryContainer(); c.ObjectList = ObjectList; AddAndIncreaseAge(c); } }
private void AddAndIncreaseAge(HistoryContainer c) { lock (_lockCointainers) { //add _containerList.Add(c); _refLastContainer = c; //Too many items? delete the oldest one if (_containerList.Count >= SettingsManager.TrackingSet.MaximumHistoryCount) _containerList.RemoveAt(0); //Increase the age foreach (HistoryContainer hc in _containerList) { hc.FrameAge++; } } }