Exemplo n.º 1
0
        private void ReplayChanges(IndividualCollectionChange change, IList ilist)
        {
            switch (change.CollectionChangeType)
            {
            case CollectionChangeType.Add:
                if (change.Index == ilist.Count)
                {
                    ilist.Add(change.Object.CValue);
                    Items.Add(change.Object);
                }
                else
                {
                    ilist.Insert(change.Index, change.Object.CValue);
                    Items.Insert(change.Index, change.Object);
                }
                break;

            case CollectionChangeType.Remove:
                ilist.RemoveAt(change.Index);
                Items.RemoveAt(change.Index);
                break;
            }
        }
Exemplo n.º 2
0
        private void ReplayChanges(IndividualCollectionChange change, IList ilist)
        {
            switch (change.CollectionChangeType)
            {
                case CollectionChangeType.Add:
                    if (change.Index == ilist.Count)
                    {
                        ilist.Add(change.Object.CValue);
                        Items.Add(change.Object);
                    }
                    else
                    {
                        ilist.Insert(change.Index, change.Object.CValue);
                        Items.Insert(change.Index, change.Object);
                    }
                    break;

                case CollectionChangeType.Remove:
                    ilist.RemoveAt(change.Index);
                    Items.RemoveAt(change.Index);
                    break;
            }
        }