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