예제 #1
0
 internal DictionaryItemEnumerator(DictionaryStorage dict)
 {
     _dict   = dict;
     _keys   = new List <object>(dict.Count);
     _values = new List <object>(dict.Count);
     foreach (KeyValuePair <object, object> kvp in dict.GetItems())
     {
         _keys.Add(kvp.Key);
         _values.Add(kvp.Value);
     }
     _size = _values.Count;
     _pos  = -1;
 }
예제 #2
0
        internal DictionaryValueEnumerator(DictionaryStorage dict)
        {
            _dict   = dict;
            _size   = dict.Count;
            _values = new object[_size];
            int i = 0;

            foreach (KeyValuePair <object, object> kvp in dict.GetItems())
            {
                _values[i++] = kvp.Value;
            }
            _pos = -1;
        }