With enum under .net the biggest number you can use is ULong.
This mean a maximum of 64 flags.
What would be the alternative when you need more than 64 flags?
Edit
Sorry, I forgot to add this, alternative that would still work with bitwise operations at least these one; and and or.
using Josh Einstein suggestion, I came up with this, does it make sense?
class bitArrayFlag
{
private const int flagSize = 255; //allow X numbers of flags
public BitArray flag1;
public BitArray flag2;
public BitArray flagN;
public bitArrayFlag()
{
int flagPos = 0;
bool[] flagBit = new bool[flagSize];
flagBit[flagPos] = true;
flag1 = new BitArray(flagBit);
flagBit[flagPos] = false;
flagPos += 1;
flagBit[flagPos] = true;
flag2 = new BitArray(flagBit);
//...
//...
//...
flagBit[flagPos] = false;
flagPos += 1;
flagBit[flagPos] = true;
flagN = new BitArray(flagBit);
}
}