title: how to get value of an unknown enum by name of enum and name of value?
body: <p>sorry for asking this question but i didn't found the right solution for this task:</p>
  
  <p>I've got a Enum, which is named "myEnum" (MyEnum isn't known by the function)
  I Need to get the int value of a Value of myEnum</p>
  
  <p>Example:<br>
  A Programmer named its enum "myEnum":</p>
  
  <pre><code> public enum myEnum
   {
       foo = 1,
       bar = 2,
   }
  </code></pre>
  
  <p>my function should do the following:
       Get the Value of "foo" of "myEnum" by string</p>
  
  <p>function should opened by:</p>
  
  <pre><code> public int GetValueOf(string EnumName, string EnumConst)
   {
  
   }
  </code></pre>
  
  <p>so when Programmer A opens it by :</p>
  
  <pre><code> int a = GetValueOf("myEnum","foo");
  </code></pre>
  
  <p>it should return 1</p>
  
  <p>and when Programmer B has an Enum named "mySpace", wants to return "bar" with Value 5</p>
  
  <pre><code>int a = GetValueOf("mySpace","bar")
  </code></pre>
  
  <p>should return 5</p>
  
  <p>how can i do this?</p>