private void Save(IDocumentProcessor processor, HostService hostService, DocumentBuildContext context) { hostService.Models.RunAll( m => { try { if (m.Type != DocumentType.Override) { using (new LoggerFileScope(m.OriginalFileAndType.File)) { Logger.LogVerbose($"Plug-in {processor.Name}: Saving..."); m.BaseDir = context.BuildOutputFolder; var result = processor.Save(m); if (result != null) { HandleSaveResult(context, hostService, m, result); } } } } finally { m.Dispose(); } }); }
private void Save(IDocumentProcessor processor, HostService hostService, DocumentBuildContext context) { hostService.Models.RunAll( m => { if (m.Type != DocumentType.Override) { using (new LoggerFileScope(m.OriginalFileAndType.File)) { Logger.LogVerbose($"Plug-in {processor.Name}: Saving..."); m.BaseDir = context.BuildOutputFolder; if (m.PathRewriter != null) { m.File = m.PathRewriter(m.File); } var result = processor.Save(m); if (result != null) { m.File = TemplateProcessor.UpdateFilePath(m.File, result.DocumentType, context.TemplateCollection); result.ModelFile = TemplateProcessor.UpdateFilePath(result.ModelFile, result.DocumentType, context.TemplateCollection); HandleSaveResult(context, hostService, m, result); } } } }); }