public static TemplateErrorCollection ToTemplateErrorCollection(this CompilerErrorCollection errors)
        {
            if (errors == null)
            {
                throw new ArgumentNullException(nameof(errors));
            }

            var templateErrors = new TemplateErrorCollection();

            foreach (CompilerError error in errors)
            {
                templateErrors.Add(new TemplateError(error.ErrorText, error.ErrorNumber, new Location(error.FileName, error.Line, error.Column), error.IsWarning));
            }

            return(templateErrors);
        }
Пример #2
0
 void ITextTemplatingEngineHost.LogErrors(TemplateErrorCollection errors)
 {
     Errors.AddRange(errors);
 }
Пример #3
0
 public void AddRange(TemplateErrorCollection errors)
 {
     this.errors.AddRange(errors);
 }