Im trying to figure out why the following is making me cast the enumerator.
Here is the enumerator:
This code here works but forces me to cast the JSOEnum.SecurityCode:public enum SecurityLevel { L1 = 0, L2, L3, L4, L5 }
This code does not work because it requires a cast.Code:JOSEnum.SecurityLevel test = (JOSEnum.SecurityLevel)Enum.Parse(typeof(JOSEnum), "test");
Code:JOSEnum.SecurityLevel test = Enum.Parse(typeof(JOSEnum.SecurityLevel), "test");
So my question is, why do I have to cast? Wouldn't the parse function take care of the type?