The "value" ranges from 0 to 15 (its possible values). When will those 4 "if" conditions be met? If my (int)value = 2 does this mean 0010?
if ((int)value & 0x1)
{
//statement here
}
if ((int)value & 0x2)
{
//statement here
}
if ((int)value & 0x4)
{
//statement here
}
if ((int)value & 0x8)
{
//statement here
}
value
(readif(value & 0x4)
as "Is the 3rd bit ofvalue
set (=1)). As you seemingly have problems understanding the code, I assume it is not yours. This (and the fact that you are not asking for review) makes this question off-topic for CR.SE.Enum.HasFlag
method to test for bits. See: Enum.HasFlag.