static void Main() { var ints = new MyColl <int>(new[] { 1, 2, 3, 4 }); foreach (int n in ints) { Console.WriteLine(n); } Console.ReadKey(); }
public NestedEnumerator(MyColl <T> coll) { _coll = coll; Monitor.Enter(_coll._items.SyncRoot); _index = -1; }