Skip to content

Instantly share code, notes, and snippets.

Created Dec 25, 2012
What would you like to do?
// Получение значения Enum по строковому имени
EnumType dp = EnumType.None;
if(Enum.IsDefined(typeof(EnumType), enumElementName))
dp = (EnumType)Enum.Parse(typeof(EnumType), enumElementName);
Console.WriteLine("Sorry, no element exists!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment