Пример #1
0
 public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator()
 {
     foreach (var value in this.vector)
     {
         yield return(new KeyValuePair <TKey, TValue>(IndexedVector <TKey, TValue> .GetKey(value), value));
     }
 }
    /// <summary>
    /// Gets the dictionary's enumerator.
    /// </summary>
    public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator()
    {
        int count = this.backingVector.Count;

        for (int i = 0; i < count; ++i)
        {
            TValue item = this.backingVector[i];
            yield return(new KeyValuePair <TKey, TValue>(
                             IndexedVector <TKey, TValue> .GetKey(item),
                             item));
        }
    }