Exemplo n.º 1
0
        public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator()
        {
            KeyValuePair <TKey, TValue>[] array;

            using (_lock.EnterReadLock())
            {
                array = new KeyValuePair <TKey, TValue> [_dictionary.Count];
                _dictionary.CopyTo(array, 0);
            }

            return(array.AsEnumerable().GetEnumerator());
        }
Exemplo n.º 2
0
 public static IDictionary <TKey, TValue> AsDictionary <TKey, TValue>(this KeyValuePair <TKey, TValue> onlyItem)
 {
     return(onlyItem.AsEnumerable().ToDictionary());
 }