Enumerations:Bit Flag Enums 1
using System;
[Flags]
public enum BitValues: uint
{
NoBits = 0,
Bit1 = 0x00000001,
Bit2 = 0x00000002,
Bit3 = 0x00000004,
Bit4 = 0x00000008,
Bit5 = 0x00000010,
AllBits = 0xFFFFFFFF
}
public class BitFlagEnums
{
public static void Member(BitValues value)
{
// do some processing here
}
public static void Main()
{
Member(BitValues.Bit1 | BitValues.Bit2);
}
}
Related examples in the same category