With classes like this you always will need type cast for collection's element.
In general case:
object whoKnowsWhat
MyObject my = whoKnowsWhat as MyObject;
if (my == nulll)
my./... use my
MyObject my = (MyObject)whoKnowsWhat;
Don't do all that in your case!
Simply don't use name space
System.Collections
, it's mostly obsolete; use
System.Collections.Generic
instead. At least you will be away from the problems with casting.
—SA