Here's the simplest possible code for creating a custom collection class in the Microsoft .NET Framework that includes support for For…Each loops, an indexer method and initializing collections with { ...
This class is most useful in VB10, where you can pass in a multi-statement lamba expression for the MoveNextFunc. You can use this generic template in VB8 and VB9, but without support for ...