Move TempFile to own class
This commit is contained in:
@ -10,7 +10,7 @@ using WGneu.Helpers;
|
||||
namespace WGneu.Documents {
|
||||
public abstract class Document : IDisposable {
|
||||
|
||||
private Utils.TemporaryFile? PdfFile = null;
|
||||
private TempFile? PdfFile = null;
|
||||
|
||||
public Document(string title) {
|
||||
Title = title;
|
||||
@ -51,8 +51,8 @@ namespace WGneu.Documents {
|
||||
}
|
||||
|
||||
public async Task Generate() {
|
||||
var pdf = new Utils.TemporaryFile("pdf");
|
||||
using (var tmpHtml = new Utils.TemporaryFile("html")) {
|
||||
var pdf = new TempFile("pdf");
|
||||
using (var tmpHtml = new TempFile("html")) {
|
||||
await File.WriteAllTextAsync(tmpHtml.FilePath, await Render());
|
||||
await Pdf.Convert(tmpHtml.FilePath, pdf.FilePath);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ namespace WGneu.Documents {
|
||||
doc.Save(path);
|
||||
}
|
||||
|
||||
public static void Show(Utils.TemporaryFile file, string title) {
|
||||
public static void Show(TempFile file, string title) {
|
||||
App.MainDispatcher.BeginInvoke(() => {
|
||||
var w = new DocumentViewerWindow(title, file);
|
||||
w.Show();
|
||||
|
Reference in New Issue
Block a user