xxxxxxxxxx
public void NestedDictIteration(Dictionary<string,object> nestedDict)
{
foreach (string key in nestedDict.Keys)
{
Console.WriteLine(key);
object nextLevel = nestedDict[key];
if(nextLevel == null)
{
continue;
}
NestedDictIteration((Dictionary<string, object>)nextLevel);
}
}
xxxxxxxxxx
public static void PrintDict<K,V>(Dictionary<K,V> dict)
{
for (int i = dict.Length - 1; i >= 0; i--)
{
KeyValuePair<K, V> entry = dict.ElementAt(i);
Console.WriteLine(entry.Key + " : " + entry.Value);
}
}