I'm aware of Enum.TryParse(), but it doesn't handle the namespace and type being present in the string. Say I have the following enum:
namespace MyNamespace
{
enum MyEnum
{
One,
Two,
Three
}
}
I can't use Enum.TryParse("MyNamespace.MyEnum.One", out MyEnum xxx)
. It returns false because "MyNamespace.MyEnum.One" is not recognized.
Enum.TryParse("One", out MyEnum xxx)
works fine.
Is there a way I can do that with any other mechanism in .Net?