fix: 尝试修复检查更新弹窗炸了的问题

This commit is contained in:
MistEO
2022-12-01 23:40:07 +08:00
parent c040584e18
commit a17b75c50b
3 changed files with 4 additions and 26 deletions

View File

@@ -2150,10 +2150,11 @@ namespace MeoAsstGui
// var backup = _language;
ViewStatusStorage.Set("GUI.Localization", value);
System.Windows.Forms.MessageBoxManager.Unregister();
System.Windows.Forms.MessageBoxManager.Yes = Localization.GetString("Ok", value);
System.Windows.Forms.MessageBoxManager.No = Localization.GetString("ManualRestart", value);
System.Windows.Forms.MessageBoxManager.Register();
var result = MessageBox.Show(
var result = _windowManager.ShowMessageBox(
Localization.GetString("LanguageChangedTip", value),
Localization.GetString("Tip", value),
MessageBoxButton.YesNo,

View File

@@ -1201,30 +1201,6 @@ namespace MeoAsstGui
}
}
/*
public void CheckAndShutdown()
{
if (Shutdown)
{
System.Diagnostics.Process.Start("shutdown.exe", "-s -t 60");
var result = _windowManager.ShowMessageBox("已刷完,即将关机,是否取消?", "提示", MessageBoxButton.OK, MessageBoxImage.Question);
if (result == MessageBoxResult.OK)
{
System.Diagnostics.Process.Start("shutdown.exe", "-a");
}
}
if (Hibernate)
{
System.Diagnostics.Process.Start("shutdown.exe", "-h");
}
if (Suspend)
{
System.Diagnostics.Process.Start("rundll32.exe", "powrprof.dll,SetSuspendState 0,1,0");
}
}
*/
/// <summary>
/// Gets a value indicating whether it is initialized.
/// </summary>

View File

@@ -452,10 +452,11 @@ namespace MeoAsstGui
public void AskToRestart()
{
System.Windows.Forms.MessageBoxManager.Unregister();
System.Windows.Forms.MessageBoxManager.Yes = Localization.GetString("Ok");
System.Windows.Forms.MessageBoxManager.No = Localization.GetString("ManualRestart");
System.Windows.Forms.MessageBoxManager.Register();
var result = MessageBox.Show(
var result = _windowManager.ShowMessageBox(
Localization.GetString("NewVersionDownloadCompletedDesc"),
Localization.GetString("NewVersionDownloadCompletedTitle"),
MessageBoxButton.YesNo,