September 23, 2007

Iterating Over Dictionary Entries

Dictionary<string, XXX> m_MyDictionary = new Dictionary<string, XXX>()
foreach (KeyValuePair kvp in m_MyDictionary)
{
 DoSomething(kvp.Key);
 DoSomethingElse(kvp.Value);
}

No comments: