Given the enum:
[Flags]
public enum mytest
{
a = 1,
b = 2,
c = 4
}
I\'ve come up with two ways to represent all va
If it makes sense to have an All member, just provide it directly:
[Flags]
public enum mytest
{
a = 1,
b = 2,
c = 4,
All = 7
}
Though, a more idiomatic way to write these could be:
[Flags]
public enum MyTest
{
A = 1,
B = 1 << 0x01,
C = 1 << 0x02,
All = A | B | C
}
This shows the logical progression of the enum values, and in the All case, makes it easy to add another member.