我在MainWindow()中有一个逻辑如下。发生的事情是,在我上传许可证文件并关闭DXWindow后,我称之为
System.Windows.Forms.Application.Restart(); Application.Current.Shutdown();我立即注意到它启动我的应用程序它不再检查MainWindow()中的逻辑。当我运行重启时如何强制它返回MainWindow()?
public MainWindow()
{
bool licStatu = IsValidLicenseAvailable();
if (licStatu == false)
{
if (licStatu == false)
{
DXWindow1 l1 = new DXWindow1();
l1.ShowDialog();
if (l1.DialogResult.HasValue && !l1.DialogResult.Value)
Application.Current.Shutdown();
else {
System.Windows.Forms.Application.Restart();
Application.Current.Shutdown();
}
}
}
else
{
if (IsValidLicenseAvailable() == false)
{
DXWindow1 l1 = new DXWindow1();
l1.ShowDialog();
if (l1.DialogResult.HasValue && !l1.DialogResult.Value)
Application.Current.Shutdown();
}
else {
if (crossDay == 0 )
{
// MessageBox.Show("al okCross day :" + crossDay);
InitializeComponent();
}
}
}