Windows Dev Center

IIterable<T> interface

Exposes an iterator that supports simple iteration over a collection of a specified type.

.NET:  This interface appears as System.Collections.Generic.IEnumerable<T>. In any case where a Windows Runtime type has implemented IIterable<T>, .NET code can use the APIs of IEnumerable<T> instead. C# code can use foreach, Visual Basic code can use For Each...Next. All the .NET extension methods that are based on IEnumerable<T> and included in .NET for Windows Store apps are accessible (including the System.Linq extensions, so long as you've included the namespace).

Syntax


generic<typename T>
public interface class IIterable

Type parameters

T

The type of objects to iterate.

Members

The IIterable interface inherits from the IUnknown interface. IIterable also has these types of members:

Methods

The IIterable interface has these methods. It also inherits methods from the Object class.

MethodDescription
First Returns an iterator for the items in the collection.

 

Remarks

When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.IEnumerable<T> interface. Because of how the projections were done, the GetEnumerator method isn't always available as a direct callable method on the types that project IEnumerable<T> as implemented, but enumerating the collection with the standard enumeration syntax (foreach) is still supported. The compiler does the type-casting for you and you won't need to cast to IEnumerable explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator from a class, cast to IEnumerable<T>, using a constraint in the cast that matches the item type of the collection.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.FoundationContract, introduced version 1.0

Namespace

Windows::Foundation::Collections

Metadata

Windows.Foundation.FoundationContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows::Foundation::Collections

Metadata

Windows.winmd

Attributes

[Version(0x06020000)]

See also

IIterator<T>

 

 

Show:
© 2015 Microsoft