Example #1
0
        public void Update(
            EventBean[] newData,
            EventBean[] oldData)
        {
            updateObserver?.Updated(this);
            if (newData != null) {
                for (int i = 0; i < newData.Length; i++) {
                    arrayList.Insert(0, newData[i]);
                }
            }

            if (oldData != null) {
                for (int i = 0; i < oldData.Length; i++) {
                    arrayList.RemoveAt(arrayList.Count - 1);
                }
            }
        }
        /// <summary>
        /// Refreshes the random access data with the updated information.
        /// </summary>
        /// <param name="sortedEvents">is the sorted window contents</param>
        /// <param name="currentSize">is the current size of the window</param>
        /// <param name="maxSize">is the maximum size of the window</param>
        public void Refresh(OrderedDictionary <object, object> sortedEvents, int currentSize, int maxSize)
        {
            _updateObserver.Updated(this);
            _sortedEvents = sortedEvents;
            _currentSize  = currentSize;

            _enumerator    = null;
            _cacheFilledTo = 0;
            if (_cache == null || _cache.Length < maxSize)
            {
                _cache = new EventBean[maxSize];
            }
        }