May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Enumerations can be designed for supporting bitwise operations by marking them with the Flags attribute. This allows combining enumeration values with bitwise operators such as OR. Consider the following implementation of the Sports enumeration that was described previously:

By applying the Flags attribute, the values for each enumeration value now become bitflag patterns that have a binary representation such as the following:

Basically combining all values with the OR operator will result in a 11111111 binary value. For ...
Read now
Unlock full access