Рет қаралды 5,289
In C#, an enum represents a single named value. But with a little bit of work, we can store multiple value in a single enum variable.
Source code available at: github.com/JasperKent/Flags-Enum
Topics include:
- Enum flags convention
- Combining enums with | (or)
- Querying enums with & (and)
- Querying enums with HasFlag
- Improving appearance with the FlagsAttribute
- Selecting enum size