Phase 5: 系统托盘与开机自启
- 系统托盘: NotifyIcon 常驻, 程序化生成 32x32 图标, 左键切换显示/隐藏, 右键菜单(显示主界面/设置/彻底退出) - 窗口关闭拦截: OnClosing 取消关闭改为 Hide(), 退出菜单执行真实 Shutdown() - 开机自启: AutoStartHelper 写入/删除 HKCU\...\Run 注册表项, UI 开关按钮显示 ✔/⊗ 状态 - 静默启动: -autostart 参数下 mainWindow.Hide() 直接最小化到托盘 - 类型冲突解决: ImplicitUsings=disable + GlobalUsings.cs 统一全局 using, 消除 WPF/WinForms 共享类型冲突 - 测试: 75 tests total (含 AutoStartHelper 2 tests)
This commit is contained in:
20
PersonalToolBox/GlobalUsings.cs
Normal file
20
PersonalToolBox/GlobalUsings.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Collections.ObjectModel;
|
||||
global using System.Collections.Specialized;
|
||||
global using System.ComponentModel;
|
||||
global using System.Diagnostics;
|
||||
global using System.IO;
|
||||
global using System.Linq;
|
||||
global using System.Runtime.InteropServices;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Windows;
|
||||
global using System.Windows.Controls;
|
||||
global using System.Windows.Data;
|
||||
global using System.Windows.Input;
|
||||
global using System.Windows.Interop;
|
||||
global using System.Windows.Media;
|
||||
global using System.Windows.Threading;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Win32;
|
||||
Reference in New Issue
Block a user