Esempio n. 1
0
        /*
         * Method:    WarningHandler
         *
         * This is the delegate for warning events.
         *
         */
        private void WarningHandler(
            object sender,
            BuildWarningEventArgs errorEvent)
        {
            if (this.Verbosity == LoggerVerbosity.Quiet)
            {
                return;
            }

            CompilerError e = new CompilerError(errorEvent.File,
                                                errorEvent.LineNumber,
                                                errorEvent.ColumnNumber,
                                                errorEvent.Code,
                                                errorEvent.Message);

            e.IsWarning = true;

            // Format error so that flush to task pane can understand it
            NativeMethods.ThrowOnFailure(_output.OutputTaskItemString(
                                             this.GetFormattedErrorMessage(e),
                                             VSTASKPRIORITY.TP_NORMAL,
                                             VSTASKCATEGORY.CAT_BUILDCOMPILE,
                                             String.Empty,
                                             -1,
                                             errorEvent.File,
                                             (uint)errorEvent.LineNumber,
                                             errorEvent.Message));
        }
Esempio n. 2
0
        /*
         * Method:    ErrorHandler
         *
         * This is the delegate for error events.
         *
         */
        private void ErrorHandler(
            object sender,
            BuildErrorEventArgs errorEvent)
        {
            CompilerError e = new CompilerError(errorEvent.File,
                                                errorEvent.LineNumber,
                                                errorEvent.ColumnNumber,
                                                errorEvent.Code,
                                                errorEvent.Message);

            e.IsWarning = false;

            // Format error so that flush to task pane can understand it
            NativeMethods.ThrowOnFailure(_output.OutputTaskItemString(
                                             this.GetFormattedErrorMessage(e),
                                             VSTASKPRIORITY.TP_HIGH,
                                             VSTASKCATEGORY.CAT_BUILDCOMPILE,
                                             String.Empty,
                                             -1,
                                             errorEvent.File,
                                             (uint)errorEvent.LineNumber,
                                             errorEvent.Message));
        }
Esempio n. 3
0
 /*
  * Method:  ShutdownLogger
  *
  * This is called when the build complete.
  *
  */
 private void ShutdownLogger()
 {
     // If there was any error/warnings, send them to the task list
     NativeMethods.ThrowOnFailure(_output.FlushToTaskList());
 }