fix(startup): suppress legacy splash under WPF shell
This commit is contained in:
@@ -87,8 +87,12 @@ namespace Lskj.Main.Model
|
|||||||
public static void StartForm()
|
public static void StartForm()
|
||||||
{
|
{
|
||||||
bool isStart = true;
|
bool isStart = true;
|
||||||
|
bool useLegacySplash = ExternalMainShell == null;
|
||||||
// 加载Splash动画界面
|
// 加载Splash动画界面
|
||||||
SplashForm.ShowForm();
|
if (useLegacySplash)
|
||||||
|
{
|
||||||
|
SplashForm.ShowForm();
|
||||||
|
}
|
||||||
//CheckLocalConfig();
|
//CheckLocalConfig();
|
||||||
// C#数据库连接检查
|
// C#数据库连接检查
|
||||||
bool isLocalConnect = false;
|
bool isLocalConnect = false;
|
||||||
@@ -108,27 +112,36 @@ namespace Lskj.Main.Model
|
|||||||
if (!DBConfig.Instance.CreateConnection(DBConfig.Instance.Connection))
|
if (!DBConfig.Instance.CreateConnection(DBConfig.Instance.Connection))
|
||||||
{
|
{
|
||||||
MessageUtil.Show(ResourceKeys.UnConnectServer);
|
MessageUtil.Show(ResourceKeys.UnConnectServer);
|
||||||
SplashForm.HideForm();
|
if (useLegacySplash)
|
||||||
|
{
|
||||||
|
SplashForm.HideForm();
|
||||||
|
}
|
||||||
DialogResult result = RunConfigForm();
|
DialogResult result = RunConfigForm();
|
||||||
isStart = result == DialogResult.OK;
|
isStart = result == DialogResult.OK;
|
||||||
}
|
}
|
||||||
if (isStart)
|
if (isStart)
|
||||||
{
|
{
|
||||||
// Delphi数据库连接检查
|
// Delphi数据库连接检查
|
||||||
if (!DBConfig.Instance.ServerType.Equals("达梦数据库"))
|
if (!DBConfig.Instance.ServerType.Equals("达梦数据库"))
|
||||||
{
|
{
|
||||||
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
|
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
|
||||||
{
|
{
|
||||||
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
|
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
|
||||||
SplashForm.HideForm();
|
if (useLegacySplash)
|
||||||
|
{
|
||||||
|
SplashForm.HideForm();
|
||||||
|
}
|
||||||
RunConfigForm();
|
RunConfigForm();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SplashForm.HideForm();
|
|
||||||
|
if (useLegacySplash)
|
||||||
|
{
|
||||||
|
SplashForm.HideForm();
|
||||||
|
}
|
||||||
// 汉化dev控件
|
// 汉化dev控件
|
||||||
BaseResources.Localization(LocalizationType.CHS);
|
BaseResources.Localization(LocalizationType.CHS);
|
||||||
// 启动登录页面
|
// 启动登录页面
|
||||||
@@ -150,7 +163,10 @@ namespace Lskj.Main.Model
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SplashForm.HideForm();
|
if (useLegacySplash)
|
||||||
|
{
|
||||||
|
SplashForm.HideForm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user