/// <summary>
 /// Method that will communicate an error via the shell callback mechanism
 /// </summary>
 /// <param name="level">Level or severity</param>
 /// <param name="message">Text displayed to the user</param>
 /// <param name="line">Line number of error</param>
 /// <param name="column">Column number of error</param>
 protected virtual void GeneratorError(uint level, string message, uint line, uint column)
 {
     Microsoft.VisualStudio.Shell.Interop.IVsGeneratorProgress progress = GeneratorProgress;
     if (progress != null)
     {
         progress.GeneratorError(0, level, message, line, column);
     }
 }
Exemple #2
0
 protected virtual void GeneratorErrorCallback(bool warning, int level, string message, int line, int column)
 {
     Microsoft.VisualStudio.Shell.Interop.IVsGeneratorProgress codeGeneratorProgress = this.CodeGeneratorProgress;
     if (codeGeneratorProgress != null)
     {
         if (line > 0)
         {
             line--;
         }
         if (column > 0)
         {
             column--;
         }
         ErrorHandler.ThrowOnFailure(codeGeneratorProgress.GeneratorError(warning ? -1 : 0, (uint)level, message, (uint)line, (uint)column));
     }
 }