App icon; language/theme follow Windows on first run; flush save on exit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 14:52:25 +01:00
parent 5a8eba836b
commit 90898d7040
16 changed files with 107 additions and 36 deletions

View File

@@ -17,7 +17,10 @@ namespace ReminderOrganizer
base.OnStartup(e);
// Only one instance: a second start would show duplicate reminders and race on tasks.json.
_singleInstance = new System.Threading.Mutex(true, "MichaelMedia.ReminderOrganizer", out var isFirst);
// Test runs with their own data folder (REMINDER_ORGANIZER_DATA) get their own lock.
var mutexName = "MichaelMedia.ReminderOrganizer" +
(Environment.GetEnvironmentVariable("REMINDER_ORGANIZER_DATA") is { Length: > 0 } d ? "." + d.GetHashCode() : "");
_singleInstance = new System.Threading.Mutex(true, mutexName, out var isFirst);
if (!isFirst)
{
Shutdown();
@@ -40,6 +43,7 @@ namespace ReminderOrganizer
protected override void OnExit(ExitEventArgs e)
{
(MainWindow as MainWindow)?.OnAppExit();
Services.NotificationService.SharedTrayIcon?.Dispose();
_singleInstance?.Dispose();
base.OnExit(e);