New Features in C# 2.0—Implement GetEnumerator with Complex Data Structures

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:Tutorials
C# Tutorials

New Features in C# 2.0

© 2005 O'Reilly Media, Inc.

Implement GetEnumerator with Complex Data Structures

To add an iterator to your original LinkedList class, you’ll implement IEnumerable<T> on both LinkedList and the Node class:

public class LinkedList<T> : 
  IEnumerable<T>
public class Node<T> : 
  IComparable<Node<T>>, IEnumerable<Node<T>>


Previous_Page_.gif Next_Page_.gif

Personal tools