/*
* Namespace Summary
* Copyright (C) 2005+ Bogdan Damian Constantin
* E-Mail: damianbcpetro@gmail.com
* WEB: http://www.sourceforge.net/projects/dataholder
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License 2.1 or later, as
* published by the Free Software Foundation. See the included License.txt
* or http://www.gnu.org/copyleft/lesser.html for details.
*
*/
using System;
using System.Collections;
namespace DataHolder.Containers{
/// <summary>
/// Enumerator used fot GenericDataCollectionView collection
/// </summary>
public class GenericDataEnumerator : IEnumerator
{
private int currentPos = -1;
private BaseGenericDataCollectionView collectionView;
public GenericDataEnumerator(BaseGenericDataCollectionView collectionView)
{
this.collectionView = collectionView;
}
#region IEnumerator Members
public void Reset()
{
currentPos = 0;
}
public object Current
{
get
{
return ((IList)collectionView)[currentPos];
}
}
public bool MoveNext()
{
currentPos++;
return (currentPos < collectionView.Count);
}
#endregion
}
}
|