Enum cast

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Enum cast

Postby CyborgDE » Tue Oct 06, 2015 2:05 am


works well under windows but not under javascript (beta 5) :

Code: Select all

        public override ValueType ConvertFromString( string input, Type toType )
         if (toType.IsEnum)
            var vals = Enum.GetValues(toType);
            int i = 0;
            foreach (var val in vals)
               if (val.ToString() == input)
                  return val as ValueType;
            throw new ArgumentException("ENum value not found " + input + " in " + toType.ToString());
         return (Enum.Parse(toType, input, false)) as ValueType;

the cast destroys the enum type ...

If I move to code to the calling function, it works ...

Reagards, Uwe

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests