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!"; theme.HandleDarkMode(); if (config.Save()) { msg = "选项已更新"; //处理开机启动 if (!ShortcutHelper.SetStartup(config.options.General.Startup)) { msg = "选项已更新,但是 “开机启动选项” 可能未生效。"; } //处理休息间隔调整 if (mainService.SetWarnTime(config.options.General.WarnTime)) { msg = "选项已更新,提醒计时已重启。"; } //处理主题切换 theme.SetTheme(config.options.Style.Theme.ThemeName); } Modal(msg); }
private void applyCommand_action(object obj) { string msg = "更新失败!请尝试重启程序或删除配置文件Config.xml!"; theme.HandleDarkMode(); if (config.Save()) { msg = $"{Application.Current.Resources["Lang_Optionupdated"]}"; //处理开机启动 if (!ShortcutHelper.SetStartup(config.options.General.Startup)) { msg = $"{Application.Current.Resources["Lang_Optionupdated"]}"; } //处理休息间隔调整 if (mainService.SetWarnTime(config.options.General.WarnTime)) { msg = $"{Application.Current.Resources["Lang_Optionupdated"]}"; } //处理主题切换 theme.SetTheme(config.options.Style.Theme.ThemeName); } Modal(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, "提示"); }