Loop through "selected" Enum values?
<p>I know how to loop through enum list of properties, but how would I loop through all "selected" enum properties? For example, if one did <code>Prop1 | Prop2</code> against <code>public enum Foo { Prop1; Prop2; Prop3 }</code>, how would I achieve this?</p>

<p>This is what I have now:</p>

<pre><code>var values = Enum.GetValues(typeof(FileStatus)).Cast&lt;FileStatus&gt;();
foreach (var value in values)
{
}
</code></pre>

<p>It loops through all enum properties, but I'd like to loop only the ones that were "selected".</p>

<p>Update: <code>[Flags]</code> attribute was set.</p>

<p>Update 2: The enum contains a large number of properties, I can't and won't type/hardcode a single property check, instead I want to dynamically loop through each of them and check if my enum instance <code>Bar</code> contains the looped item set.</p>
