Beispiel #1
0
        // *** Protected Methods ***

        protected void PostUpdate(DataListUpdate update)
        {
            foreach (IUpdatableCollection collection in updateSubscriptions)
            {
                collection.Update(update);
            }
        }
Beispiel #2
0
        private void Update_Add(DataListUpdate update)
        {
            // If the entire update is outside of the visible collection then ignore it

            if (update.Index > currentCount)
            {
                return;
            }

            currentCount += update.Count;
            base.OnItemsAdded(update.Index, update.Count);
        }
Beispiel #3
0
        private void Update_Remove(DataListUpdate update)
        {
            // If the entire update is outside of the visible collection then ignore it

            if (update.Index >= currentCount)
            {
                return;
            }

            // If the update overlaps the boundary of the visible collection then only remove visible items

            int removedItemCount = Math.Min(update.Count, currentCount - update.Index);

            currentCount -= removedItemCount;
            base.OnItemsRemoved(update.Index, removedItemCount);
        }
Beispiel #4
0
        // *** IUpdatableCollection Members ***

        void IUpdatableCollection.Update(DataListUpdate update)
        {
            switch (update.Action)
            {
            case DataListUpdateAction.Add:
                base.OnItemsAdded(update.Index, update.Count);
                break;

            case DataListUpdateAction.Remove:
                base.OnItemsRemoved(update.Index, update.Count);
                break;

            case DataListUpdateAction.Reset:
                base.Reset();
                break;
            }
        }
Beispiel #5
0
        // *** IUpdatableCollection Members ***

        void IUpdatableCollection.Update(DataListUpdate update)
        {
            switch (update.Action)
            {
            case DataListUpdateAction.Add:
                Update_Add(update);
                break;

            case DataListUpdateAction.Remove:
                Update_Remove(update);
                break;

            case DataListUpdateAction.Reset:
                Update_Reset();
                break;
            }
        }