Combinable enumerations in C# .NET
November 8, 2016 Leave a comment
You’ve probably encountered cases with combined enum values using the pipe character, i.e. the “bitwise or” operator ‘|’:
Size.Large | Size.ExtraLarge
Let’s see an example of how to create such an enum.
The enumeration is decorated with the Flags attribute like in the following example: