Пример #1
0
        /// <summary>
        /// Records the error in the parsing report and determines if to continue with the parsing.
        /// </summary>
        private bool ShouldContinueAfterError(ParsingErrorReason error, FileParsingReport parsingReport, string usageFile, long lineNumber)
        {
            parsingReport.Errors.Add(new ParsingError(Path.GetFileName(usageFile), lineNumber, error));
            if (parsingReport.Errors.Count > _maximumParsingErrorsCount)
            {
                parsingReport.IsCompletedSuccessfuly = false;
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// Creates a new instance of the <see cref="ParsingError"/> class.
 /// </summary>
 /// <param name="fileName">The name of the file containing the error line</param>
 /// <param name="line">The error line number</param>
 /// <param name="reason">The error reason</param>
 public ParsingError(string fileName, long line, ParsingErrorReason reason)
 {
     FileName    = fileName;
     LineNumber  = line;
     ErrorReason = reason;
 }