Ejemplo n.º 1
0
        private void Add(ErrorInfo info, string /*!*/ message, string fullPath, ErrorPosition pos, params string[] args)
        {
            Debug.Assert(message != null);

            var severity = UpgradeSeverity(info.Severity);

            if (Add(info.Id, message, severity, info.Group, fullPath, pos) && info.Id >= 0)
            {
                counts[severity]++;
            }
        }
Ejemplo n.º 2
0
 protected override bool Add(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos)
 {
     return(sink.AddInternal(id, message, severity, group, fullPath, pos));
 }
Ejemplo n.º 3
0
        protected override bool Add(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos)
        {
            if (fullPath != null)
            {
                Debug.Assert(pos.IsValid);
                output.Write(String.Format("{0}({1},{2}): ", fullPath, pos.FirstLine, pos.FirstColumn));
            }

            if (id >= 0)
            {
                output.WriteLine(String.Format("{0} PHP{1:d4}: {2}", severity.ToCmdString(), id, message));
            }
            else
            {
                output.WriteLine(message);
            }

            return(true);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns whether the warning has been reported.
 /// </summary>
 protected abstract bool Add(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos);
Ejemplo n.º 5
0
        internal bool AddInternal(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos, bool increaseCount)
        {
            severity = UpgradeSeverity(severity);

            bool result = Add(id, message, severity, group, fullPath, pos);

            if (increaseCount)
            {
                counts[severity]++;
            }

            return(result);
        }
Ejemplo n.º 6
0
        //public void AddConfigurationError(ConfigurationErrorsException/*!*/ e)
        //{
        //    if (e == null)
        //        throw new ArgumentNullException("e");

        //    ErrorPosition pos = new ErrorPosition(e.Line, 0, e.Line, 0);
        //    StringBuilder message = new StringBuilder(e.BareMessage);
        //    Exception inner = e.InnerException;
        //    while (inner != null)
        //    {
        //        message.Append(" ");
        //        message.Append(inner.Message);
        //        inner = inner.InnerException;
        //    }
        //    Add(FatalErrors.ConfigurationError, e.Filename, pos, message.ToString());
        //}

        internal bool AddInternal(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos)
        {
            return(AddInternal(id, message, severity, group, fullPath, pos, false));
        }
Ejemplo n.º 7
0
 internal void Add(ErrorInfo info, string fullPath, ErrorPosition pos, params string[] args)
 {
     Add(info, CoreResources.GetString(info.MessageId, args), fullPath, pos);
 }