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()); }
public static IDictionary <TKey, TValue> AsDictionary <TKey, TValue>(this KeyValuePair <TKey, TValue> onlyItem) { return(onlyItem.AsEnumerable().ToDictionary()); }