title: How can I implement IEnumerator<T>?
body: <p>This code is not compiling, and it's throwing the following error:</p>
  
  <blockquote>
    <p>The type 'TestesInterfaces.MyCollection' already contains a definition for 'Current'</p>
  </blockquote>
  
  <p>But when I delete the ambiguous method, it keeps giving other errors.</p>
  
  <p>Can anyone help?</p>
  
  <pre><code>public class MyCollection&lt;T&gt; : IEnumerator&lt;T&gt;
  {
      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 &gt; actualIndex);
      }
  
      public void Reset()
      {
          actualIndex = -1;
      }
  
      void IDisposable.Dispose() { }
  
      public Object Current
      {
          get
          {
              return Current;
          }
      }
  
  
      public T Current
      {
          get
          {
              try
              {
                  T element = vector[actualIndex];
                  return element;
              }
              catch (IndexOutOfRangeException e)
              {
                  throw new InvalidOperationException(e.Message);
              }
          }
      }
  }
  </code></pre>