I’m trying to implement my own IEnumerator but there is a line I don’t understand:
what is the reason for: “object IEnumerator.Current”?
public abstract class buttonEnumerator : IEnumerator<SaveFile>
{
int position;
public SaveFile Current => throw new System.NotImplementedException();
object IEnumerator.Current => Current; //don't understand this line
public void Dispose()
{
throw new System.NotImplementedException();
}
public bool MoveNext() //move to next element
{
throw new System.NotImplementedException();
}
public void Reset()
{
position = 0;
}
}