Пример #1
0
 /// <summary>
 /// Private function that is called for each found problem in output of pdflatex when
 /// calling parseOutput(). addProblemMarker() fits the arguments into addProblemEventArgs
 /// so that addProblemEventHandler addProblem can be triggered.
 /// </summary>
 private void addProblemMarker(String error, String causingSourceFile, int linenr, Severity severity, TexCompiler.Job job)
 {
     if (OnTexError != null)
     {
         TexError e = new TexError();
         e.error             = error;
         e.causingSourceFile = causingSourceFile;
         e.linenr            = linenr;
         if (job != null)
         {
             if (e.causingSourceFile == null)
             {
                 e.inincludefile = true;
             }
             else
             {
                 e.inincludefile = (String.Compare(e.causingSourceFile.Trim(),
                                                   System.IO.Path.GetFullPath(job.path), true) != 0);
             }
             if (!e.inincludefile && linenr > 0)
             {
                 e.linenr = job.TempFileLineToEditorLine(e.linenr);
             }
             if (!e.inincludefile)
             {
                 //trim preview file ending.
                 e.causingSourceFile = e.SourceFileName.Substring(0, (e.SourceFileName.Length - Helper.GetPreviewFilename().Length - Helper.GetPreviewFilenameExt().Length));
             }
         }
         e.pos      = -1;
         e.severity = severity;
         OnTexError(this, e, job);
     }
 }
Пример #2
0
        /// <summary>
        /// Private function that is called for each found problem in output of pdflatex when
        /// calling parseOutput(). addProblemMarker() fits the arguments into addProblemEventArgs
        /// so that addProblemEventHandler addProblem can be triggered.
        /// </summary>
        private static void addProblemMarker(String error, String causingSourceFile, int linenr, Severity severity, TexCompiler.Job job, List <TexError> AddToThisList)
        {
            // if (OnTexError != null)
            // {
            TexError e = new TexError();

            e.error             = error;
            e.causingSourceFile = causingSourceFile;
            e.Line = linenr;
            if (job != null)
            {
                if (e.causingSourceFile == null)
                {
                    e.inincludefile = true;
                }
                else
                {
                    e.inincludefile = (String.Compare(e.causingSourceFile.Trim().Replace('/', '\\'),
                                                      System.IO.Path.GetFullPath(job.path), true) != 0);
                }
                if (!e.inincludefile && linenr > 0)
                {
                    e.Line = job.TempFileLineToEditorLine(e.Line);
                }
                if (!e.inincludefile && e.causingSourceFile != null)
                {
                    // trim preview file ending.
                    e.causingSourceFile = e.causingSourceFile.Trim();
                    if (e.causingSourceFile.EndsWith(Consts.PreviewFilename + Consts.PreviewFilenameExt))
                    {
                        e.causingSourceFile = e.SourceFileName.Substring(0, (e.SourceFileName.Length - Consts.PreviewFilename.Length - Consts.PreviewFilenameExt.Length));
                    }
                }
            }
            e.Pos      = -1;
            e.severity = severity;
            AddToThisList.Add(e);
            //       OnTexError(this, e, job);
            //   }
        }