How would you expect to convert from a
bool
to an
enum
?
An
enum
is
int
based, and can have a wide variety of values (2^32 of them!) while a
bool
is restricted to two values:
true
and
false
There is no default conversion from a
bool
to an
int
of any type,
enum
or not.
You could possibly write method that did it, or just use the "?" operator:
MyEnum me = myBool? MyEnum.Value1 : MyEnum.Value2;
But to be honest, I can't help thinking there is something wrong with your design if you think you need this.