상속: IDisposable
예제 #1
0
 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++;
         }
     }
 }
예제 #2
0
 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++;
         }
     }
 }
예제 #3
0
 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);
 }