public CompilerError CreateError(ISourceLineInfo lineInfo, string res, params string[] args)
 {
     return(new CompilerError(
                lineInfo.Uri, lineInfo.StartLine, lineInfo.StartPos, /*errorNumber:*/ string.Empty,
                /*errorText:*/ XslTransformException.CreateMessage(res, args)
                ));
 }
Exemple #2
0
        public string FormatMessage(string res, IList <string> args)
        {
            string[] arr = new string[args.Count];

            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = args[i];
            }

            return(XslTransformException.CreateMessage(res, arr));
        }
Exemple #3
0
        public void ReportWarning(ISourceLineInfo lineInfo, string res, params string[] args)
        {
            int warningLevel = 1;

            if (0 <= Settings.WarningLevel && Settings.WarningLevel < warningLevel)
            {
                // Ignore warning
                return;
            }
            CompilerError error = CreateError(lineInfo, res, args);

            if (Settings.TreatWarningsAsErrors)
            {
                error.ErrorText = XslTransformException.CreateMessage(SR.Xslt_WarningAsError, error.ErrorText);
                CompilerErrorColl.Add(error);
            }
            else
            {
                error.IsWarning = true;
                CompilerErrorColl.Add(error);
            }
        }
        public CompilerError CreateCompileExceptionError(Exception e)
        {
            string errorText = XslTransformException.CreateMessage(/*[XT_041]*/ Res.Xslt_ScriptCompileException, e.Message);

            return(new CompilerError(this.endFileName, this.endLine, this.endPos, /*errorNumber:*/ string.Empty, errorText));
        }