Beispiel #1
0
 public override IEnumerator <ICollection <TValue> > GetEnumerator()
 {
     using (IEnumerator <TKey> enumKeys = myDictionary.EnumerateKeys())
     {
         while (enumKeys.MoveNext())
         {
             TKey key = enumKeys.Current;
             yield return(new ValuesForKeyCollection(myDictionary, key));
         }
     }
 }
Beispiel #2
0
 public override IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator()
 {
     using (IEnumerator <TKey> enumKeys = myDictionary.EnumerateKeys())
     {
         while (enumKeys.MoveNext())
         {
             TKey key = enumKeys.Current;
             IEnumerator <TValue> enumValues;
             if (myDictionary.TryEnumerateValuesForKey(key, out enumValues))
             {
                 using (enumValues)
                 {
                     while (enumValues.MoveNext())
                     {
                         yield return(new KeyValuePair <TKey, TValue>(key, enumValues.Current));
                     }
                 }
             }
         }
     }
 }
Beispiel #3
0
 public override IEnumerator <TKey> GetEnumerator()
 {
     return(myDictionary.EnumerateKeys());
 }