Esempio n. 1
0
        public void CopyTo(KeyValuePair <TKey, TValue>[] array, int arrayIndex)
        {
            // Take a snapshot of the current list with a converter
            var list = ListSelect.Create(_internalCollection.List, node => node.KeyValuePair);

            list.CopyTo(array, arrayIndex);
        }
Esempio n. 2
0
 public void Clear()
 {
     DoReadWriteNotify(
         // Get the list of keys and values from the internal list
         () => ListSelect.Create(_internalCollection.List, x => x.KeyValuePair),
         // remove the keys from the dictionary, remove the range from the list
         (items) => ImmutableDictionaryListPair <TKey, TValue> .Empty,
         // Notify which items were removed
         (items) => new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, items, 0)
         );
 }
Esempio n. 3
0
        void ICollection.CopyTo(Array array, int arrayIndex)
        {
            var list = ListSelect.Create(_internalCollection.List, node => node.KeyValuePair);

            ((ICollection)list).CopyTo(array, arrayIndex);
        }
        public IList <KeyValuePair <TKey, TValue> > GetRange(int index, int count)
        {
            var subList = List.GetRange(index, count);

            return(ListSelect.Create(subList, (s) => s.KeyValuePair));
        }