Chapter 15. Enumerated Types and Bit Flags

In this chapter:

Enumerated Types

Bit Flags

Adding Methods to Enumerated Types

In this chapter, I’ll discuss enumerated types and bit flags. Because Windows and many programming languages have used these constructs for so many years, I’m sure that many of you are already familiar with how to use enumerated types and bit flags. However, the common language runtime (CLR) and the Framework Class Library (FCL) work together to make enumerated types and bit flags real object-oriented types that offer cool features that I suspect most developers aren’t familiar with. It’s amazing to me how these features, which are the focus of this chapter, make developing application code so much easier.

Enumerated Types

An enumerated ...

Get CLR via C#, Fourth Edition 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.