Title is terrible, but I wasn't too sure what to put.
I'm trying to create Switch Statement
using the char index of a string and an Enum using this wrapper to get the value of the selected enum from a Description, it pretty much allows you to store a string to an enum value.
Here is my if statement
if (msgComingFromFoo[1] == Convert.ToChar(Message.Code.FOO_TRIGGER_SIGNAL.EnumDescriptionToString()))
{
//foo
}
and here is my Switch statement
switch (msgComingFromFoo[1])
{
case Convert.ToChar(Message.Code.FOO_TRIGGER_SIGNAL.EnumDescriptionToString()):
break;
}
Why is it accepting the if statement
and not the switch statement
?
I tried converting it to a char since I'm selected an index from a string, but unfortunately i didn't work.
Aucun commentaire:
Enregistrer un commentaire