コード例 #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());
        }
コード例 #2
0
 public static IDictionary <TKey, TValue> AsDictionary <TKey, TValue>(this KeyValuePair <TKey, TValue> onlyItem)
 {
     return(onlyItem.AsEnumerable().ToDictionary());
 }