Just store the type directly in the dictionary (i.e. store the result of typeof(MyEnum1)
):
Dictionary<string, Type> KeyToEnum = new Dictionary<string, Type>();
KeyToEnum["e1"] = typeof(MyEnum1);
KeyToEnum["e2"] = typeof(MyEnum2);
Object EnumValue = Enum.Parse(dic[keyString), valueString, true);
// Note that EnumValue is an object, because we can't know at compile time what the type will be.
Note that if instead of "e1", "e2"... you actually had "MyEnum1", "MyEnum2" (i.e. the actual name of the type you could do Type.GetType(MyKey)
instead of the dictionary.