Why is not Enumerator listed as a member in List<T> class

T

Tony Johansson

Hi!

In the code below I use the Enumerator that is called on class List<string>
Here is a link that show every member in the List<T> class
http://msdn.microsoft.com/en-us/library/d9hw1as6.aspx
If I carefully look through all these members I can't find a sight of any
Enumerator.
Can anybody explain that ??
If I google for List<T>.Enumerator this specific member is found but why is
not this listed when I
look at all the members in the List<T> class.

public static void Main()
{
List<string> stringList = new List<string>();
stringList.Add("opel");
stringList.Add("saab");
stringList.Add("volvo");
stringList.Add("fiat");

List<string>.Enumerator e = stringList.GetEnumerator();
while (e.MoveNext())
Console.WriteLine(e.Current);
}

//Tony
 
P

Peter Duniho

Tony said:
Hi!

In the code below I use the Enumerator that is called on class List<string>
Here is a link that show every member in the List<T> class
http://msdn.microsoft.com/en-us/library/d9hw1as6.aspx
If I carefully look through all these members I can't find a sight of any
Enumerator. [...]

The link you provide includes only: constructor, fields, methods,
properties, and events (but List<T> has no public fields or events, so
of course none are listed).

You need to look at the class hierarchy to see nested classes. For example:
http://msdn.microsoft.com/en-us/library/system.collections.generic.aspx

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top