DataListItemCollection.GetEnumerator 方法
定义
返回包含 IEnumerator 中的所有 DataListItem 对象的 DataListItemCollection 接口。Returns a IEnumerator interface that contains all DataListItem objects in the DataListItemCollection.
public:
virtual System::Collections::IEnumerator ^ GetEnumerator();
public System.Collections.IEnumerator GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Function GetEnumerator () As IEnumerator
返回
包含 IEnumerator 中的所有 DataListItem 对象的 DataListItemCollection 接口。A IEnumerator interface that contains all DataListItem objects in the DataListItemCollection.
实现
注解
使用此方法创建一个 System.Collections.IEnumerator 可以轻松地循环访问以获取集合中的每个项的 DataListItemCollection 。Use this method to create a System.Collections.IEnumerator that can be easily iterated through to get each item in the DataListItemCollection collection.
使用 IEnumerator.Current 属性可获取集合中当前指向的项。Use the IEnumerator.Current property to get the item currently pointed to in the collection.
使用 IEnumerator.MoveNext 方法移动到集合中的下一项。Use the IEnumerator.MoveNext method to move to the next item in the collection.
使用 IEnumerator.Reset 方法可将枚举数移回初始位置。Use the IEnumerator.Reset method to move the enumerator back to the initial position.
备注
创建 System.Collections.IEnumerator 对象或使用 IEnumerator.Reset 方法将枚举数移到集合中的第一项后,必须调用 IEnumerator.MoveNext 方法。After you create a System.Collections.IEnumerator object or use the IEnumerator.Reset method to move the enumerator to the first item in the collection, you must call the IEnumerator.MoveNext method. 否则,由属性表示的项 IEnumerator.Current 是不确定的。Otherwise, the item represented by the IEnumerator.Current property is undefined.