Esempio n. 1
0
        // *** Protected Methods ***

        protected void PostUpdate(DataListUpdate update)
        {
            foreach (IUpdatableCollection collection in updateSubscriptions)
            {
                collection.Update(update);
            }
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }