From 5a478c1b54b4fa866bed7fe89fa68379410b596a Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Wed, 26 Feb 2025 21:13:18 +0100 Subject: [PATCH] [chore:] more document creation information on last page --- MainWindow.axaml.cs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs index 28baa6d..8dfcd63 100644 --- a/MainWindow.axaml.cs +++ b/MainWindow.axaml.cs @@ -25,7 +25,7 @@ using System.Globalization; // - PDF Export keine Namen -> Error // - White Mode Access // - Information on last page - +// - Fixed Width at task edit field namespace PLG_Exam @@ -644,9 +644,30 @@ namespace PLG_Exam fontsmall, XBrushes.Black, bottomDescriptionRect + ); + + // Beschreibung am unteren Rand platzieren + var informationRect = new XRect( + 50, // X-Position (horizontaler Abstand) + 50, // Y-Position (Seitenhöhe - Textbereichshöhe - Margin) + endpage.Width - 100, // Breite des Bereichs + 300 // Höhe des Bereichs ); - //endpageGfx.DrawString($"Erstellt mit PLG Exam - powered by PLG Development\nhttps://github.com/PLG-Development/PLG-Exam\n(c) 2024 - PLG Development", fontsmall, XBrushes.Black, new XRect(0,0, firstPage.Width, firstPage.Height), XStringFormats.BottomLeft); + string outinfo = $"Dieses Dokument wurde automatisch erstellt und enthält alle Bestandteile Ihrer Prüfung. Bitte prüfen Sie alle Inhalte vor der Abgabe und speichern das Dokument an einem sicheren Ort. Nutzen Sie zur Abgabe bitte einen USB-Stick."; + outinfo += $"\n\nErstelldatum: {DateTime.Now.ToString("dd.MM.yyyy", CultureInfo.CreateSpecificCulture("de-DE"))}"; + outinfo += $"\nErstellzeit: {DateTime.Now.ToString("HH:mm:ss", CultureInfo.CreateSpecificCulture("de-DE"))} Uhr"; + outinfo += $"\nGerätename: {Environment.MachineName}"; + outinfo += $"\nBetriebssystem: {Environment.OSVersion.VersionString}"; + outinfo += $"\nIP-Adresse: {System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)}"; + outinfo += $"\nBenutzername: {Environment.UserName}"; + + endformatter.DrawString( + outinfo, + fontsmall, + XBrushes.Black, + informationRect + ); document.Save(filePath);