TreeNodeCollection, like some of the other control collections in System.Windows.Forms, implements IEnumerable. Is there any design reason behind this or is it just a hangover from the days before generics?
+3
A:
Yes, there are many .NET Framework collection, that does not implement generic IEnumerable.
I think that's because after 2.0 there was no (at least not so match) development of the core part of FW.
Meanwhile I suggest you to make use of following workaround:
using System.Link;
...
var nodes = GetTreeNodeCollection().OfType<TreeNode>();
Artem Tikhomirov
2008-09-01 08:17:21