I searched for a while, but could not find a solution. I have an assembly in the GAC. I have to load it using reflection. After that I need to turn and turn to Ennum. But instead, I can just get it MemberInfo[]. I do not understand how to convert MemberInfo[]to Enum.
I have a code like this:
public class MyClass
{
public enum MyEnum
{
MyVavue,
MyValue2
}
}
Assembly s = Assembly.Load("test");
Type type = s.GetTypes()[1];
MemberInfo[] memberInfos = type.GetMembers(
BindingFlags.Public |
BindingFlags.Static);
source
share