public static void PrintDocuments(IWorker worker, IList<ITemplatePrntDoc> docs) { using (FileWorker fileWorker = new FileWorker()) { int step = 0; foreach (var document in docs) { worker.ReportProgress(step, document.Name); var template = document.GetTemplate(); if (template != null) fileWorker.OpenInOffice(template, true, FileEditMode.Document, true); if (worker.IsCancelled) return; step++; } } }
public static void PrintDocuments(IWorker worker, IList <IPrintableOdtDocument> docs) { using (FileWorker fileWorker = new FileWorker()) { int step = 0; foreach (var document in docs) { worker.ReportProgress(step, document.Name); var template = document.GetTemplate(); int copies = document.CopiesToPrint; if (template != null) { fileWorker.OpenInOffice(template, true, FileEditMode.Document, copies, PrintSettings); } if (worker.IsCancelled) { return; } step++; } } }
public OpenedFile(FileWorker worker, IDocTemplate template, FileEditMode mode) { myFileWorker = worker; editMode = mode; Template = template; tempDir = Path.GetTempPath(); tempFile = template.Name + ".odt"; TempFilePath = Path.Combine (tempDir, tempFile); }