System.Collections.IEnumerable Interface

public interface IEnumerable

Assembly

mscorlib

Library

BCL

Summary

Implemented by classes that support a simple iteration over instances of the class.

Description

[Note: IEnumerable contains the System.Collections.IEnumerable.GetEnumerator method. The consumer of an object should call this method to obtain an enumerator for simple iteration over an instance of a collection.

Implement this interface to support the foreach semantics of C#.

]

See Also

System.Collections Namespace

Members

IEnumerable Methods

IEnumerable.GetEnumerator Method


IEnumerable.GetEnumerator Method

IEnumerator GetEnumerator();

Summary

Returns a IEnumerator that can be used for simple iteration over a collection.

Return Value

A IEnumerator that can be used for simple iteration over a collection.

Description

[Behaviors: As described above.]

[Usage: For a detailed description regarding the use of an enumerator, see IEnumerator.]

See Also

System.Collections.IEnumerable Interface, System.Collections Namespace