how do i switch on an enum which have the flags attribute set (or more precisely is used for bit operations) ?
I want to be able to hit all cases in a switch that matche
What about a Dictionary
that you will fill like
dict.Add(CheckType.Form, DoSomething);
dict.Add(CheckType.TempDate, DoSomethingElse);
...
a decomposition of your value
flags = Enum.GetValues(typeof(CheckType)).Where(e => (value & (CheckType)e) == (CheckType)e).Cast();
and then
foreach (var flag in flags)
{
if (dict.ContainsKey(flag)) dict[flag]();
}
(code untested)