March 2004
Intermediate to advanced
560 pages
26h 47m
English
public class FlagsAttribute : Attribute { // Constructors public FlagsAttribute (); }
|
BA Enums in the runtime are just like enums in the C++ programming language. That is, they are really just aliases for integral types. There is no enforcement in the runtime, languages, or verifier that ensures that a value stored in an enum has a valid name associated with it. For example, this is legal code: FileMode f = (FileMode) 42; The implication of this is that a robust library should always check to see if the value being passed in is legal. The Flags attribute indicates that the enum was designed such that not all the legal values have a name; some legal values are combinations of values with names. For example, in the AttributeTargets ... |
Read now
Unlock full access