예제 #1
0
 ListDifference NotifyDeletion(ListDifference diff, TResult[] items)
 {
     if (items.Length == 1)
     {
         OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, items[0], diff.NewIndex));
     }
     else
     {
         OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, items, diff.NewIndex));
     }
     return(diff);
 }
예제 #2
0
        ListDifference NotifyInsertion(ListDifference diff, TResult[] items)
        {
            int index = diff.NewIndex;

            foreach (var item in items)
            {
                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));
                ++index;
            }

            /*
             * if (items.Length == 1)
             * {
             *  OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items[0], diff.NewIndex));
             * }
             * else
             * {
             *  OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items, diff.NewIndex));
             * }*/
            return(diff);
        }