I've got an abstract class (Object2D), and several class that inherits Object2D (DisplayObject2D for instance)
I use a List to store all references to these objects.
I'd like to iterate through every DisplayObject2D in this List.
So far, the following code is working, but being new to C# development, I wanted to know if there wasn't any better practice to do so :
List<Object2D> tmp = objects.FindAll( delegate( Object2D obj )
{ return obj is DisplayObject2D; } );
foreach( DisplayObject2D obj in tmp )
{
...
}
Thanks in advance!