Create function which parse an Enum in C#
<p>I know that to parse a string to specific <code>enum</code> like:</p>

<pre><code>enum AnEnumType 
{
   TEST_,
   OTHER_TEST_,
   OTHERS_
}

enum OtherEnumType 
{
   TEST1_,
   OTHER_TEST1_,
   OTHERS1_
}


string aValueString = "TEST_";

AnEnumType result = (AnEnumType)Enum.Parse(typeof(AnEnumType), aValueString);
</code></pre>

<p>So, I want to create a function, a generic one which use parser for my <code>enum</code>(s) like:</p>

<pre><code>public Type ConvertStringToAnEnum(string value, Type anyType){

return (anyType)Enum.Parse(typeof(anyType), aValueString);
}
</code></pre>

<p>But I guess that is not OK...</p>

<p>How to make the function which parse any enumeration type specified as argument in function? </p>

<p>like I want to call <code>OtherEnumType result = ConvertStringToAnEnum("TEST1_", OtherEnumType)</code></p>
