C# Lists, Foreach, and Types
<p>I was wondering if there is a version of foreach that checks only for a specific type and returns it. </p>

<p>For example consider this class tree:</p>

<p>org.clixel.ClxBasic -> org.clixel.ClxObject -> org.clixel.ClxSprite -> WindowsGame1.test</p>

<p>Then consider this code</p>

<pre><code>public List&lt;ClxBasic&gt; objects = new List&lt;ClxBasic&gt;();

foreach(GroupTester tester in objects)
{
    tester.GroupTesterOnlyProperty = true;
}
</code></pre>

<p>tester.GroupTesterOnlyProperty is a property created in GroupTester. Is there some way to make something like this work, like an overload of foreach, or another snippet that might help me? I want to make it easy for a programmer to sort through the lists grabbing only what type they need.</p>
