VB
要VB
Overridable ReadOnly Property Current() As Object
Current用於在迭代過程中得到當前的對象
Public Overridable Function MoveNext() As Boolean
MoveNext用於在迭代過程中將迭代指針指向下一個對象
Overridable Sub Reset()
將枚舉數設置為其初始位置
只要集合保持不變
下需是一個具體的VB
Imports System
IteratorProduct 用此接口來向使用者提供對IEnumerator接口的操作
Public Class IteratorProduct : Implements System
Private Products As Collection
Private item As Integer =
Public Sub New()
Products = New Collection
Products
Products
Products
End Sub
Overridable ReadOnly Property Current() As Object
Get
Return Products(item)
End Get
End Property
Public Overridable Function MoveNext() As Boolean
item +=
End Function
Overridable Sub Reset()
item =
End Sub
Overridable Function GetEnumerator()
As IEnumerator Implements IEnumerable
Return Me
End Function
End Class
From:http://tw.wingwit.com/Article/program/net/201311/12284.html