public static object Parse(Type enumType, string value, bool ignoreCase)
        {
            EnumResult parseResult = new EnumResult();

            parseResult.Init(true);
            if (!TryParseEnum(enumType, value, ignoreCase, ref parseResult))
            {
                throw parseResult.GetEnumParseException();
            }
            return(parseResult.parsedEnum);
        }
        public static bool TryParse <TEnum>(string value, bool ignoreCase, out TEnum result) where TEnum : struct
        {
            bool flag;

            result = default(TEnum);
            EnumResult parseResult = new EnumResult();

            parseResult.Init(false);
            if (flag = TryParseEnum(typeof(TEnum), value, ignoreCase, ref parseResult))
            {
                result = (TEnum)parseResult.parsedEnum;
            }
            return(flag);
        }