public static void LoadHotKey() { //加载热键设置 HotKeys = HotKeys.Load(); HotKeys.RegisterError += new EventHandler <HotKeys.RegisterErrorEventArgs>((oo, ee) => { System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (var exception in ee.Exceptions) { sb.AppendLine(exception.Message); } }); mainWindow.AddLogicToHotKeys(HotKeys); HotKeys.Register(mainWindow); }