h1

Hello,

I¡¯m experiencing a strange problem, with Enum:

I can do the following with WindowState (which is an enum):

String s = typeof(WindowState).FullName

And s ¡°System.Windows.WindowState¡±.

Now if I try Type.GetType(s), I get back a null

What¡¯s going on Is this because an Enum is a value type

Thanks

Houman



Re: Visual C# General Enum GetType

Houman b

OK, I figured it out: GetType has an overload Type.GetType(string, bool) takes in a boolean. If set to true it throws an Exception.

After looking at the exception I realized that I needed to use the AssemblyQualifiedName Instead of the FullName. Now everything is cool.

Thanks

Houman