I am trying out the new HasFlags features, and was wondering if the following should work:
enum.HasFlag(AccessRights.Read | AccessRights.Writ
The | operator is bitwise or. It means that if Read is 1 and Write is 2, the value Read | Write is 3 (see its binary representation). So HasFlag returns true only if your enum variable have both Read and Write set.
|
Read
Write
Read | Write
HasFlag
enum