Example #1
0
        public void EnumerableEnumeratorTest()
        {
            var collection = new BoxCollection()
            {
                new Box()
                {
                    Name = "Box0"
                },
                new Box()
                {
                    Name = "Box1"
                },
                new Box()
                {
                    Name = "Box2"
                },
                new Box()
                {
                    Name = "Box3"
                },
                new Box()
                {
                    Name = "Box4"
                },
            };

            foreach (var box in collection)
            {
                Console.WriteLine(box.Name);
            }
        }
Example #2
0
 public BoxEnumerator(BoxCollection collection)
 {
     _collection = collection;
     curIndex    = -1;
     curBox      = default(Box);
 }