Esempio n. 1
0
 public void AddNew(List<TableObject> ObjectList)
 {
     lock (_lockCointainers)
     {
         HistoryContainer c = new HistoryContainer();
         c.ObjectList = ObjectList;
         AddAndIncreaseAge(c);
     }
 }
Esempio n. 2
0
        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++;
                }
            }
        }