Add desktop diagnostics and resilient message handling

This commit is contained in:
Misaka
2026-05-15 21:29:55 +08:00
parent 4c314c510b
commit d4b7a23e38
4 changed files with 71 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ public sealed class TrayApplicationContext : ApplicationContext
public TrayApplicationContext()
{
AppLogger.Info("Tray application starting.");
var keyboard = new KeyboardInjectionService();
var handler = new SyncMessageHandler(keyboard);
@@ -31,6 +32,7 @@ public sealed class TrayApplicationContext : ApplicationContext
}
catch (Exception ex)
{
AppLogger.Error("Failed to start tray application.", ex);
notifyIcon.BalloonTipTitle = "WirelessTextSyncer";
notifyIcon.BalloonTipText = $"Failed to start: {ex.Message}";
notifyIcon.ShowBalloonTip(5000);