Klausur-Deckblätter als Sammel-PDF aus Vorlagen vom Typ exam-cover
Neuer Dialog "Deckblätter…" bei Klausuren, Punktetabelle als Drawing mit festen Spaltenbreiten, FLOWDRAWBOX-Attribut fit=content, Stapel-Rendering mit Seitenzahl je Datensatz, Kursbezeichnung und konfigurierbares Kürzel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f56caced32
commit
dd92128464
33 files changed
+1158
-28
No files matched your search
@@ -0,0 +1,41 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace LehrerApp.Desktop.Services;
|
||||
|
||||
internal sealed class TeacherSettingsConfig
|
||||
{
|
||||
public string Abbreviation { get; set; } = "";
|
||||
}
|
||||
|
||||
/// <summary>Angaben zur Lehrkraft, die auf Formularen erscheinen (bisher nur das Kürzel fürs
|
||||
/// Klausur-Deckblatt) — aus der Konfiguration statt fest in der Vorlage, damit eine weitergegebene
|
||||
/// Vorlage nicht das Kürzel ihres Erstellers trägt.</summary>
|
||||
public sealed class TeacherSettingsService
|
||||
{
|
||||
private readonly string _configPath;
|
||||
|
||||
public TeacherSettingsService(string appDataPath) =>
|
||||
_configPath = Path.Combine(appDataPath, "teachersettings.json");
|
||||
|
||||
public string LoadAbbreviation()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(_configPath))
|
||||
return JsonSerializer.Deserialize<TeacherSettingsConfig>(File.ReadAllText(_configPath))
|
||||
?.Abbreviation ?? "";
|
||||
}
|
||||
catch { /* beschädigte Konfiguration -> leer */ }
|
||||
return "";
|
||||
}
|
||||
|
||||
public void SaveAbbreviation(string abbreviation)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.WriteAllText(_configPath,
|
||||
JsonSerializer.Serialize(new TeacherSettingsConfig { Abbreviation = abbreviation.Trim() }));
|
||||
}
|
||||
catch { /* Einstellung ist Komfort — Fehler beim Schreiben nicht an die UI durchreichen */ }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user