日別アーカイブ: 2012/08/07

[C#] IEnumerable<> と IEnumerator<> を使って独自のリストを作ってみる

HtmlDom のイテレーターを作る前に、List<> で利用される LINQ がどう動くのかをチェック。 手始めには、IEnumerable と IEnumerator を使えばよいとのことなので、自前で作ってみます。 IEnumerable(T) インターフェイス (System.Collections.Generic) http://msdn.microsoft.com/ja-jp/library/9eekhta0.aspx IEnumerable.GetEnumerator メソッド (System.Collections) http://msdn.microsoft.com/ja-jp/library/system.collections.ienumerable.getenumerator.aspx MSDN 自体に既にサンプルコードが載っているのでそれを使っていきま … 続きを読む

カテゴリー: C# | [C#] IEnumerable<> と IEnumerator<> を使って独自のリストを作ってみる はコメントを受け付けていません