Skip to content

Instantly share code, notes, and snippets.

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