private void applyCommand_action(object obj) { string msg = "更新失败!请尝试重启程序或删除配置文件Config.xml!"; if (config.Save()) { msg = "选项已成功更新"; //处理开机启动 if (!ShortcutHelper.SetStartup(config.options.General.Startup)) { msg = "选项已成功更新。但是开机启动选项可能未生效。"; } //处理离开监听开关 if (config.options.General.LeaveListener) { mainService.OpenLeaveListener(); } else { mainService.CloseLeaveListener(); } //处理休息间隔调整 mainService.SetWarnTime(config.options.General.WarnTime); //处理主题切换 theme.SetTheme(config.options.Style.Theme.ThemeName); } MessageBox.Show(msg, "提示"); }
private void applyCommand_action(object obj) { string msg = "更新失败!请尝试重启程序或删除配置文件Config.xml!"; if (config.Save()) { msg = "选项已成功更新"; //处理开机启动 if (!ShortcutHelper.SetStartup(config.options.general.startup)) { msg = "选项已成功更新。但是开机启动选项可能未生效。"; } //处理离开监听开关 if (config.options.general.leavelistener) { mainService.OpenLeaveListener(); } else { mainService.CloseLeaveListener(); } } MessageBox.Show(msg, "提示"); }