Ejemplo n.º 1
0
 public override void Add(KeyValuePair <TKey, TValue> pair)
 {
     DoReadWriteNotify(
         () => _sorter.GetInsertIndex(_internalCollection.Count, pair.Key, i => _internalCollection.List[i].Key),
         (index) => _internalCollection.Insert(index, pair),
         (index) => new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, pair, index)
         );
 }
Ejemplo n.º 2
0
 protected override int IListAdd(T item)
 {
     return(DoReadWriteNotify(
                () => _sorter.GetInsertIndex(ImmutableList.Count, item, i => _internalCollection[i]),
                (index) => ImmutableList.Insert(index, item),
                (index) => new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)
                ));
 }