title: How would you implement the IEnumerator interface?
body: <p>I have a class that map objects to objects, but unlike dictionary it maps them both ways. I am now trying to implement a custom <code>IEnumerator</code> interface that iterates through the values.</p>
  <pre><code>public class Mapper&lt;K,T&gt; : IEnumerable&lt;T&gt;, IEnumerator&lt;T&gt;
  
  {
      C5.TreeDictionary&lt;K,T&gt; KToTMap = new TreeDictionary&lt;K,T&gt;();
      C5.HashDictionary&lt;T,K&gt; TToKMap = new HashDictionary&lt;T,K&gt;();
  
      public void Add(K key, T value)
      {
          KToTMap.Add(key, value);
          TToKMap.Add(value, key);
  
      }
  
      public int Count
      {
          get { return KToTMap.Count; }
      }
      
  
      public K this[T obj]
      {
          get
          {
              return TToKMap[obj];
          }
      }
  
      public T this[K obj]
      {
          get
          {
              return KToTMap[obj];
          }
      }
  
      public IEnumerator&lt;T&gt; GetEnumerator()
      {
          return KToTMap.Values.GetEnumerator();
      }
  
      public T Current
      {
          get { throw new NotImplementedException(); }
      }
  
      public void Dispose()
      {
          throw new NotImplementedException();
      }
  
      object System.Collections.IEnumerator.Current
      {
          get { throw new NotImplementedException(); }
      }
  
      public bool MoveNext()
      {
          ;
      }
  
      public void Reset()
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>