Esempio n. 1
0
 public ConcreateIterator(ConcreateAggregate c)
 {
     this.agg = c;
 }
Esempio 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();
            }
        }