Release v0.2.0

This commit is contained in:
2026-05-20 12:53:24 +08:00
parent 09b68ada48
commit 36f4256515
12 changed files with 443 additions and 122 deletions

View File

@@ -1,10 +1,8 @@
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Windows;
using Microsoft.Win32;
namespace OmniNotify;
@@ -61,7 +59,6 @@ public sealed class AppStore
}
}
}
public sealed class NotificationRouter
{
private readonly AppState _state;
@@ -169,7 +166,6 @@ public sealed class NotificationRouter
StateChanged?.Invoke();
}
}
public sealed class LocalHttpServer : IDisposable
{
private readonly NotificationRouter _router;
@@ -273,26 +269,3 @@ public sealed class LocalHttpServer : IDisposable
_listener?.Close();
}
}
public static class StartupManager
{
private const string AppName = "OmniNotify";
public static void Apply(bool enabled)
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (key is null)
{
return;
}
if (enabled)
{
key.SetValue(AppName, Process.GetCurrentProcess().MainModule?.FileName ?? "");
}
else
{
key.DeleteValue(AppName, false);
}
}
}