c# - How can I implement IEnumerator<T>? -
this code not compiling, , it's throwing following error: the type 'testesinterfaces.mycollection' contains definition 'current' but when delete ambiguous method, keeps giving other errors. can help? public class mycollection<t> : ienumerator<t> { private t[] vector = new t[1000]; private int actualindex; public void add(t elemento) { this.vector[vector.length] = elemento; } public bool movenext() { actualindex++; return (vector.length > actualindex); } public void reset() { actualindex = -1; } void idisposable.dispose() { } public object current { { return current; } } public t current { { try { t element = vector[actualindex]; return element; } catch (indexoutofrangeexception e) {