Type Summary

						public enum FileAccess  {
     Read = 0x1,
     ReadWrite = Read | Write,
     Write = 0x2,
}

BA A large segment of our customers do not understand flag enums. Flag enums are enums whose values are meant to be combined using the bitwise OR operation. Many users would never think about using the bitwise OR operator (|) to combine values. That is why we always provide named values for the most common combinations. ReadWrite is an example of that. It is not strictly necessary, but it is much easier to discover than FileAccess.Read | FileAccess.Write.

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.