Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #enum #keyvalue
ADD COMMENT
Topic
Name
5+7 =