System.Windows.Forms.Application.Restart();是否立即加载应用程序? [英] System.Windows.Forms.Application.Restart(); does load the application straight away?
问题描述
我在MainWindow()中有如下逻辑.发生的情况是,在我上载并关闭DXWindow之后,我将其称为
I have a logic in the MainWindow() as the following. What happens is that after I upload and the DXWindow is closed I call this
System.Windows.Forms.Application.Restart();
Application.Current.Shutdown();而且我注意到它立即启动了我的应用程序,它不再检查MainWindow中的逻辑.如何迫使它重新进入
当我运行重启时的MainWindow吗?
System.Windows.Forms.Application.Restart();
Application.Current.Shutdown(); and I notice it straight away start my application it does not check the logic in the MainWindow anymore. How to force it to get back into the
MainWindow when I run the restart ?
bool licStatu = IsValidLicenseAvailable();
bool licStatu = IsValidLicenseAvailable();
}
}
}
推荐答案
我不太确定我是否理解.我最好的猜测是,您希望表单关闭事件将您的代码放入:
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.closing.aspx
I am not quite sure I understand. My best guess is that you want the Form Closing Event to put your code into:
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.closing.aspx
Office和WebBrowser将其(或与之等效的GUI技术)用于那些未保存的更改".和打开的标签"检查.
Office and the WebBrowser use it (or thier GUI technologies equivalent) for those "unsaved changes" and "open tabs" checks.
这篇关于System.Windows.Forms.Application.Restart();是否立即加载应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!