// Token: 0x060004D4 RID: 1236 RVA: 0x0001E750 File Offset: 0x0001C950
        private static string GetErrorMessage(ExprEvalErrorDescription err)
        {
            switch (err.Type)
            {
            case ExprEvalErrorType.GeneralError:
                return(err.Message);

            case ExprEvalErrorType.LexerError:
            case ExprEvalErrorType.ParsingError:
                if (string.IsNullOrEmpty(err.InvalidText))
                {
                    return(string.Format(CultureInfo.InvariantCulture, Resources.LIBCODE_ZT0_12, err.CharPosition));
                }
                return(string.Format(CultureInfo.InvariantCulture, Resources.LIBCODE_ZT0_13, err.InvalidText, err.CharPosition));

            case ExprEvalErrorType.UnknownVariable:
                return(string.Format(CultureInfo.InvariantCulture, Resources.LIBCODE_ZT0_14, CoreThresholdProcessor.FormatVariable(err.InvalidText)));

            case ExprEvalErrorType.UnknownFunction:
                return(string.Format(CultureInfo.InvariantCulture, Resources.LIBCODE_ZT0_15, err.InvalidText));

            case ExprEvalErrorType.InvalidParametersCount:
                return(string.Format(CultureInfo.InvariantCulture, Resources.LIBCODE_ZT0_16, err.InvalidText));

            default:
                return(string.Empty);
            }
        }
Esempio n. 2
0
        private static string GetErrorMessage(ExprEvalErrorDescription err)
        {
            switch ((int)err.get_Type())
            {
            case 0:
                return(err.get_Message());

            case 1:
            case 2:
                return(string.IsNullOrEmpty(err.get_InvalidText()) ? string.Format((IFormatProvider)CultureInfo.InvariantCulture, Resources.get_LIBCODE_ZT0_12(), (object)err.get_CharPosition()) : string.Format((IFormatProvider)CultureInfo.InvariantCulture, Resources.get_LIBCODE_ZT0_13(), (object)err.get_InvalidText(), (object)err.get_CharPosition()));

            case 3:
                return(string.Format((IFormatProvider)CultureInfo.InvariantCulture, Resources.get_LIBCODE_ZT0_14(), (object)CoreThresholdProcessor.FormatVariable(err.get_InvalidText())));

            case 4:
                return(string.Format((IFormatProvider)CultureInfo.InvariantCulture, Resources.get_LIBCODE_ZT0_15(), (object)err.get_InvalidText()));

            case 5:
                return(string.Format((IFormatProvider)CultureInfo.InvariantCulture, Resources.get_LIBCODE_ZT0_16(), (object)err.get_InvalidText()));

            default:
                return(string.Empty);
            }
        }