I'm converting a project from Java to C#. I've tried to search this, but all I come across is questions about enums. There is a Hashtable htPlaylist, and the loop uses Enumeration to go through the keys. How would I convert this code to C#, but using a Dictionary instead of a Hashtable?
// My C# Dictionary, formerly a Java Hashtable.
Dictionary<int, SongInfo> htPlaylist = MySongs.getSongs();
// Original Java code trying to convert to C# using a Dictionary.
for(Enumeration<Integer> e = htPlaylist.keys(); e.hasMoreElements();
{
// What would nextElement() be in a Dictonary?
SongInfo popularSongs = htPlaylist.get(e.nextElement());
}