Exemplo n.º 1
0
        public void AddRange(CompilerError[] value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            for (int i = 0; i < value.Length; i++)
            {
                this.Add(value[i]);
            }
        }
Exemplo n.º 2
0
        internal XslLoadException(CompilerError error)
            : base(SR.Xml_UserException, new string[] { error.ErrorText })
        {
            int errorLine = error.Line;
            int errorColumn = error.Column;

            if (errorLine == 0)
            {
                // If the compiler reported error on Line 0 - ignore columns, 
                //   0 means it doesn't know where the error was and our SourceLineInfo
                //   expects either all zeroes or all non-zeroes
                errorColumn = 0;
            }
            else
            {
                if (errorColumn == 0)
                {
                    // In this situation the compiler returned for example Line 10, Column 0.
                    // This means that the compiler knows the line of the error, but it doesn't
                    //   know (or support) the column part of the location.
                    // Since we don't allow column 0 (as it's invalid), let's turn it into 1 (the begining of the line)
                    errorColumn = 1;
                }
            }

            SetSourceLineInfo(new SourceLineInfo(error.FileName, errorLine, errorColumn, errorLine, errorColumn));
        }
Exemplo n.º 3
0
        public void ReportError(ISourceLineInfo lineInfo, string res, params string[] args)
        {
            CompilerError error = CreateError(lineInfo, res, args);

            CompilerErrorColl.Add(error);
        }
Exemplo n.º 4
0
 public int Add(CompilerError value) => List.Add(value);
Exemplo n.º 5
0
 public void CopyTo(CompilerError[] array, int index) => List.CopyTo(array, index);
Exemplo n.º 6
0
 public int Add(CompilerError value) => List.Add(value);