Last active
December 15, 2015 06:59
-
-
Save jacbar/5220700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Dictionary<int,string> EnumToDictionary(Type type) | |
{ | |
// all translations are in file Enums.resx key => enum attribute name | |
ResourceManager rm = new ResourceManager(typeof(Enums)); | |
return Enum.GetValues(type).Cast<int>().ToDictionary(e => e, e => rm.GetString(Enum.GetName(type, e))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment