Imagine I have the following namespace:
namespace One.Two.Three {
public static class ExampleClass{
public .....
public enum ExampleOne { one, two three }
public enum ExampleTwo { four, five, six }
public enum ExampleThree { random, text, this, is }
}
}
How can I get the Type by a string?
With the help of Getting Type of Enum witnin class through C# reflection I have tried the following, but without any result:
public Type returnEnumType(String name){
String nameSpace = (typeof(One.Two.Three.ExampleClass)).FullName;
Type type = Type.GetType(nameSpace + name);
return type
}
Type.GetType("One.Two.Three.ExampleClass.ExampleOne"); //neither works
What am I missing here?
@edit Not a duplicate. I am not trying to parse my enumerator, I am trying to get the type based on a String.