private void Button_Click_1(object sender, RoutedEventArgs e)
{
CheckForEnum(MyEnum.Male );
}
public void CheckForEnum(MyEnum en) {
int id = (int)Enum.Parse(typeof(MyEnum), Convert.ToString(en), true);
MessageBox.Show((id).ToString());
}
public enum MyEnum :int{
Male = 1 , Female=2
}
{
CheckForEnum(MyEnum.Male );
}
public void CheckForEnum(MyEnum en) {
int id = (int)Enum.Parse(typeof(MyEnum), Convert.ToString(en), true);
MessageBox.Show((id).ToString());
}
public enum MyEnum :int{
Male = 1 , Female=2
}