摘要: public class SLList<T> : IEnumerator { private ArrayList Info; private int Index; public SLList(IEnumerable<T> List) { Index = -1; Info = new ArrayList(List.Count()); foreach (var item in List) { Info.Add(item... 阅读全文
posted @ 2011-11-12 16:57 Shikyoh 阅读(731) 评论(1) 推荐(0) 编辑
摘要: 代码优先 public class NewMyClass : IEnumerable, IEnumerator { private string[] Info; private int Index; public NewMyClass(int Size) { Index = -1; Info = new string[Size]; for (int i = 0; i < Size; i++) { Info[i]... 阅读全文
posted @ 2011-11-12 15:57 Shikyoh 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 一套完整的 IEnumerator 和IEnumerable 关系 public class MyClass : IEnumerator { public MyClass(int Size) { this.Index = -1; Info = new string[Size]; for (int i = 0; i < Size; i++) { Info[i] = i.ToString(); } } ... 阅读全文
posted @ 2011-11-12 15:49 Shikyoh 阅读(348) 评论(0) 推荐(0) 编辑