First of all:
Enums in C# do not support bool as value.
So It should be integers.
If we set 2 property's of enum to the same value we can consider one of them lost.
From my understanding what you actually is trying to do is:
Somehow flag that 2 property's of enum are equal.
My suggestion:
public enum MyEnum
{
[Description("true")]
A = 1,
[Description("false")]
B = 2,
[Description("true")]
C = 3
}
Extension for Enum which will return bool
public static class EnumEx
{
public static bool GetDescriptionAsBool(this Enum value)
{
FieldInfo field = value.GetType().GetField(value.ToString());
DescriptionAttribute attribute
= Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute))
as DescriptionAttribute;
if(attribute == null)
{
//throw new SomethingWentWrongException();
}
return bool.Parse(attribute.Description);
}
}
As a result you can switch normally and at any time can check what is your enums boll flag just calling GetDescriptionAsBool method of that instance.