Horje
convert enum to keyvalue Code Example
convert enum to keyvalue
string[] names = Enum.GetNames(typeof(Translation));

Hashtable hashTable = new Hashtable();
for (int i = 0; i < names.Length; i++)
{
    hashTable[i + 1] = names[i];
}
convert enum to keyvalue
var dict = new Dictionary<int, string>();
foreach (var name in Enum.GetNames(typeof(Translation)))
{
    dict.Add((int)Enum.Parse(typeof(Translation), name), name);
}




Csharp

Related
*ngif vs ngif Code Example *ngif vs ngif Code Example
minimize maximize restore wpf buttons Code Example minimize maximize restore wpf buttons Code Example
c# get out of for loop Code Example c# get out of for loop Code Example
building a config object in XML C# Code Example building a config object in XML C# Code Example
Find Number of Repetitions of Substring Code Example Find Number of Repetitions of Substring Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9