Returns an enumerator that iterates through the collection.
Syntax
Example
Library/Library.Test/TestBTreeList.cs
C# | Copy Code |
---|
BTreeList<int> data = new BTreeList<int>(Comparer, GetSample());
BTreeList<int> copy = (BTreeList<int>) ((ICloneable) data).Clone();
using(IEnumerator<int> e1 = data.GetEnumerator())
using(IEnumerator<int> e2 = copy.GetEnumerator())
{
while(e1.MoveNext() && e2.MoveNext())
{
Assert.AreEqual(e1.Current, e2.Current);
}
Assert.IsFalse(e1.MoveNext() || e2.MoveNext());
} |
VB.NET | Copy Code |
---|
Dim data As New BTreeList(Of Integer)(Comparer, GetSample())
Dim copy As BTreeList(Of Integer) = DirectCast((DirectCast(data, ICloneable)).Clone(), BTreeList(Of Integer))
Using e1 As IEnumerator(Of Integer) = data.GetEnumerator()
Using e2 As IEnumerator(Of Integer) = copy.GetEnumerator()
While e1.MoveNext() AndAlso e2.MoveNext()
Assert.AreEqual(e1.Current, e2.Current)
End While
Assert.IsFalse(e1.MoveNext() OrElse e2.MoveNext())
End Using
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also