Beispiel #1
0
        private void ReportError(int severity, StringEnum errorNumber, params object[] arguments)
        {
            // guide: 0 == syntax error
            //        1 == the programmer probably did not intend to do this
            //        2 == this can lead to problems in the future.
            //        3 == this can lead to performance problems
            //        4 == this is just not right

            string message = CssStringMgr.GetString(errorNumber, arguments);
            CssParserException exc = new CssParserException(
                (int)errorNumber,
                severity,
                (m_currentToken != null) ? m_currentToken.Context.Start.Line : 0,
                (m_currentToken != null) ? m_currentToken.Context.Start.Char : 0,
                message
                );

            // but warnings we want to just report and carry on
            OnCssError(exc);
        }
        private void ReportError(int severity, CssErrorCode errorNumber, CssContext context, params object[] arguments)
        {
            // guide: 0 == syntax error
            //        1 == the programmer probably did not intend to do this
            //        2 == this can lead to problems in the future.
            //        3 == this can lead to performance problems
            //        4 == this is just not right

            string message = CssStrings.ResourceManager.GetString(errorNumber.ToString(), CssStrings.Culture).FormatInvariant(arguments);
            CssParserException exc = new CssParserException(
                (int)errorNumber,
                severity,
                (context != null) ? context.Start.Line : 0,
                (context != null) ? context.Start.Char : 0,
                message);

            // but warnings we want to just report and carry on
            OnCssError(exc);
        }