Exemplo n.º 1
0
 public ConcreateIterator(ConcreateAggregate c)
 {
     this.agg = c;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ConcreateAggregate con = new ConcreateAggregate();
            Iterator i = con.CreateIterator();
            con[0] = "小偷";
            con[1] = "路人甲";
            con[2] = "李四";

            object item = i.First();
            while ( item != null)
            {
                Console.WriteLine(i.Current());
                item = i.Next();
            }
        }