Elwig: Add BackupService
Test / Run tests (push) Successful in 2m48s

This commit is contained in:
2026-08-26 10:39:50 +02:00
parent 163fe0fac8
commit ca5b719630
12 changed files with 267 additions and 84 deletions
+3 -7
View File
@@ -1,20 +1,17 @@
using Elwig.Services;
using Elwig.Windows;
using System;
using System.Threading.Tasks;
namespace Elwig.Helpers.Printing {
public static class Pdf {
public static Task Init(Action? evtHandler = null) {
public static void Init(Action? evtHandler = null) {
PdfiumNative.FPDF_InitLibrary();
evtHandler?.Invoke();
return Task.CompletedTask;
}
public static Task Cleanup() {
public static void Cleanup() {
PdfiumNative.FPDF_DestroyLibrary();
return Task.CompletedTask;
}
public static void Show(TempFile file, string title) {
@@ -31,14 +28,13 @@ namespace Elwig.Helpers.Printing {
});
}
public static Task Print(string path, int copies = 1, bool doublePaged = false) {
public static void Print(string path, int copies = 1, bool doublePaged = false) {
try {
var printer = new PdfPrinter();
printer.Print(path, copies, doublePaged);
} catch (Exception exc) {
InteractionService.ShowException("Fehler beim Drucken", "Beim Drucken ist ein Fehler aufgetreten", exc);
}
return Task.CompletedTask;
}
}
}