From d2d81a482be09d1ac81a6b392a84d7778a043167 Mon Sep 17 00:00:00 2001 From: home-PC Date: Mon, 18 May 2026 23:54:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=85=B3=E6=9C=BA=E5=B7=A5=E5=85=B7=E9=A6=96?= =?UTF-8?q?=E4=B8=AA=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实现基于 WPF 的 AutoShutdown 主界面,支持关机、重启、睡眠、休眠、唤醒、锁屏和注销等电源任务。 支持指定时间和倒计时计划、执行前提醒、系统关机撤销、Windows 唤醒任务、托盘运行、自定义图标以及 OmniNotify 通知适配。 修复关闭到托盘时的运行提醒,并支持单击托盘图标打开或收起主界面。 补充 README、发布配置和 win-x64 Release 输出要求。 Release: win-x64 --- .gitignore | 6 + AutoShutdown.csproj | 27 ++ MainWindow.xaml | 282 +++++++++++++++ MainWindow.xaml.cs | 471 ++++++++++++++++++++++++++ Models/NotificationMode.cs | 7 + Models/NotificationSettings.cs | 12 + Models/PowerAction.cs | 39 +++ NotificationSettingsWindow.cs | 220 ++++++++++++ Program.cs | 103 ++++++ README.md | 56 +++ Services/NotificationService.cs | 92 +++++ Services/NotificationSettingsStore.cs | 38 +++ Services/PowerService.cs | 95 ++++++ Services/ScreenshotService.cs | 33 ++ Services/WakeService.cs | 119 +++++++ app.ico | Bin 0 -> 370070 bytes app.manifest | 11 + 17 files changed, 1611 insertions(+) create mode 100644 .gitignore create mode 100644 AutoShutdown.csproj create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.cs create mode 100644 Models/NotificationMode.cs create mode 100644 Models/NotificationSettings.cs create mode 100644 Models/PowerAction.cs create mode 100644 NotificationSettingsWindow.cs create mode 100644 Program.cs create mode 100644 README.md create mode 100644 Services/NotificationService.cs create mode 100644 Services/NotificationSettingsStore.cs create mode 100644 Services/PowerService.cs create mode 100644 Services/ScreenshotService.cs create mode 100644 Services/WakeService.cs create mode 100644 app.ico create mode 100644 app.manifest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f5edc03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +bin/ +obj/ +Screenshots/ +*.user +*.suo +*.log diff --git a/AutoShutdown.csproj b/AutoShutdown.csproj new file mode 100644 index 0000000..2943b0b --- /dev/null +++ b/AutoShutdown.csproj @@ -0,0 +1,27 @@ + + + WinExe + net8.0-windows + true + true + enable + enable + app.manifest + app.ico + AutoShutdown + AutoShutdown + 1.0.0 + + + + + + + + none + false + true + false + false + + diff --git a/MainWindow.xaml b/MainWindow.xaml new file mode 100644 index 0000000..3578918 --- /dev/null +++ b/MainWindow.xaml @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +