2012年8月15日
摘要: 我们在编码中,经常使用foreach遍历集合,能够遍历的集合必定实现了 IEnumerator接口,IEnumerator接口如下: 1 public interface IEnumerator 2 { 3 // 方法 4 //移到集合的下一个元素。如果成功则返回为 true;如果超过集合结尾,则返回false。 5 bool MoveNext(); 6 // 将集合设置为初始位置,该位置位于集合中第一个元素之前 7 void Reset(); 8 9 // 属性:获取集合中的当前元素10 object Cur... 阅读全文
posted @ 2012-08-15 16:50 Andy Niu 阅读(263) 评论(0) 推荐(0)