I am doing an VB.Net WinForm Application. It is a migration of C#.
In C# I have a variable defined like this.
private static Dictionary<string, ExportFormatType> dicExtensiones =
new Dictionary<string, ExportFormatType> {
{".pdf", ExportFormatType.PortableDocFormat},
{".doc", ExportFormatType.WordForWindows},
{".xls", ExportFormatType.Excel},
{".rtf", ExportFormatType.RichText},
{".html", ExportFormatType.HTML40},
{".txt", ExportFormatType.Text}
};
And i migrated to this..
Private Shared dicExtensiones = New Dictionary(Of String, ExportFormatType) From
{{".pdf", ExportFormatType.PortableDocFormat},
{".doc", ExportFormatType.WordForWindows},
{".xls", ExportFormatType.Excel},
{".rtf", ExportFormatType.RichText},
{".html", ExportFormatType.HTML40},
{".txt", ExportFormatType.Text}}
Now I need to Loop through all ítems and get each value...
In C# is like this.
List<String> lista = new List<string>();
foreach (var item in dicExtensiones)
{
lista.Add(Enum.GetName(typeof(ExportFormatType), item.Value));
lista.Add("*" + item.Key);
}
The problem i have is that I do know how to migrate
Enum.GetName(typeof(ExportFormatType), item.Value);
to VB.Net, because Enum.GetName
does not exists in VB.Net
How can I do it?