title: iterating on enum type
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/105372/how-do-i-enumerate-an-enum">How do I enumerate an enum?</a>  </p>
  </blockquote>
  
  
  
  <p>I don't know if it is possible to do what I want to do, but I think why not.</p>
  
  <p>I have example enum:</p>
  
  <pre><code>public enum Animals {
      Cat,
      Dog,
      ...
  }
  </code></pre>
  
  <p>What I want to do is to iterate on this enum. I want it work like that:</p>
  
  <pre><code>foreach( var type in Animals ) {
      Console.WriteLine( type.toString() );
  }
  </code></pre>
  
  <p>and the output will be:</p>
  
  <pre><code> Cat
   Dog
  </code></pre>
  
  <p>Is it possible? I don't want to put every item to an array, and then iterate, I want to iterate directly on this enum.   </p>