mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Cleaned up enum flags example. Talked about bitwise operators & and |.
This commit is contained in:
parent
33ffabafc5
commit
04a01fe872
@ -692,7 +692,10 @@ on a new line! ""Wow!"", the masses cried";
|
||||
public BikeBrand Brand; // After declaring an enum type, we can declare the field of this type
|
||||
|
||||
// Decorate an enum with the FlagsAttribute to indicate that multiple values can be switched on
|
||||
[Flags] // Any class derived from Attribute can be used to decorate types, methods, parameters etc
|
||||
// Any class derived from Attribute can be used to decorate types, methods, parameters etc
|
||||
// Bitwise operators & and | can be used to perform and/or operations
|
||||
|
||||
[Flags]
|
||||
public enum BikeAccessories
|
||||
{
|
||||
None = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user