Initial commit: ReminderOrganizer WPF app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:44:02 +01:00
commit 5ca2770829
37 changed files with 3350 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
#nullable enable
using System;
using Microsoft.Win32;
namespace ReminderOrganizer.Services
{
public class AutostartService : IAutostartService
{
private const string RegistryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
private const string AppName = "ReminderOrganizer";
public bool IsAutostartEnabled
{
get
{
try
{
using var key = Registry.CurrentUser.OpenSubKey(RegistryKey, false);
var path = key?.GetValue(AppName) as string;
return path == Environment.ProcessPath;
}
catch
{
return false;
}
}
}
public void ToggleAutostart()
{
try
{
using var key = Registry.CurrentUser.OpenSubKey(RegistryKey, true);
if (key == null) return;
if (IsAutostartEnabled)
{
key.DeleteValue(AppName, false);
}
else
{
var path = Environment.ProcessPath;
if (!string.IsNullOrEmpty(path))
{
key.SetValue(AppName, path);
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"[AutostartService] Failed: {ex.Message}");
}
}
}
}