title: Get type of specific enum
body: <p>I have a class that contains several enumerateds, like this:</p>
  
  <pre><code>public class MyEnumerateClass
  {
      public enum Enum1
      {
          enum1Value1,
          enum1Value2
      }
  
      public enum Enum2
      {
          enum2Value1,
          enum2Value2
      }
   }
  </code></pre>
  
  <p>I have a method that takes any of that Enums like this:</p>
  
  <pre><code> public void GetValue(MyEnumerateClass enumerateField)
   {
        switch (enumerateField)
        {
            case enum1Value1:
               ... do stuff here ...
               break;
        .......... stuff ..........
        }
    }
  </code></pre>
  
  <p>As we can appreciate, that <code>GetValue</code> allows me to accept any of the two values declared previously. But I have a problem:</p>
  
  <p>When I need to check the enumerate type and check if it's <code>Enum1</code> or <code>Enum2</code>, I don't know how to handle it... </p>
  
  <pre><code> public void GetType(MyEnumerateClass enumerateField)
   {
          enumerateField.values(); // To do this I need to know the type of the enumerate
   }
  </code></pre>
  
  <p>So, how can I get the enumerate type if it's inside <code>MyEnumerateClass</code>?</p>