Does any have a more elegant way of doing this?
[Flags]
public enum SomeFlaggedEnum
{
Value1 = 1,
Value2 = 2,
Value3 = 4
}
private SomeFlaggedEnum _myFlags;
public bool EnabledValue1
{
set
{
if (value)
{
_myFlags |= SomeFlaggedEnum.Value1;
}
else
{
_myFlags &= ~SomeFlaggedEnum.Value1;
}
}
}
I know there is probably a simple answer and I'm just way over thinking it...
EDIT: The enum was incorrect as pointed out in one of the answers. This was only in this example and not in the actual code.