Open sandboxFocus

Property IsFlags

IsFlags

Gets or sets a value indicating whether the enum is annotated with FlagsAttribute.

Declaration
bool IsFlags { get; set; }
Property Value
Type Description
bool
Remarks

Setting this property to true adds the attribute, and setting it to false removes it. Adding the attribute through AddAttribute(AttributeConstruction) has the same effect, and this property then reports true.

The attribute changes how the value of the enum is formatted and parsed at run time, and it does not change the value of any member. An author who sets this property assigns the value of every member explicitly, because neither the language nor Metalama derives a power of two from the position of a member.

See Also