In this chapter, I’ll discuss enumerated types and bit flags. Since Windows has 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 .NET Framework Class Library (FCL) work together to make enumerated types and bit flags real object-oriented types that offer cool new features that I suspect most developers aren’t familiar with. It’s amazing to me how these new features, which are the focus of this chapter, make developing application code so much easier.
An enumerated type is a type that defines a set of symbolic names and value pairs. For example, the