Share via


FlagsAttribute Class

Indicates that an enumeration can be treated as a bit field (a set of flags).

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

[AttributeUsageAttribute]
[SerializableAttribute]
public class FlagsAttribute : Attribute

Remarks

In general, you use bit fields for lists of elements that might occur in combination, whereas generally you use enumeration constants for lists of mutually exclusive elements. For this reason, bit fields are designed such that you can combine elements with a bitwise OR operation to generate unnamed values; you cannot do this with enumerated constants.

Note that different programming languages vary in their use of bit fields and enumeration constants.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

FlagsAttribute Members
System Namespace