Skip to content

Commit

Permalink
Update App.xaml.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzying2001 committed Dec 9, 2023
1 parent 54fe931 commit 8814db2
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions CefFlashBrowser/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,41 @@ public App() : base()
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
InitCefFlash();

if (GlobalData.Settings.FirstStart)
try
{
if (WindowManager.ShowSelectLanguageDialog())
GlobalData.Settings.FirstStart = false;
return;
}
InitCefFlash();

if (e.Args.Length == 0)
{
WindowManager.ShowMainWindow();
return;
}
if (GlobalData.Settings.FirstStart)
{
if (WindowManager.ShowSelectLanguageDialog())
GlobalData.Settings.FirstStart = false;
return;
}

GlobalData.IsStartWithoutMainWindow = true;
foreach (var arg in e.Args)
{
if (UrlChecker.IsLocalSwfFile(arg))
if (e.Args.Length == 0)
{
WindowManager.ShowSwfPlayer(arg);
WindowManager.ShowMainWindow();
return;
}
else

GlobalData.IsStartWithoutMainWindow = true;
foreach (var arg in e.Args)
{
WindowManager.ShowBrowser(arg);
if (UrlChecker.IsLocalSwfFile(arg))
{
WindowManager.ShowSwfPlayer(arg);
}
else
{
WindowManager.ShowBrowser(arg);
}
}
}
catch (Exception ex)
{
WindowManager.Alert(ex.ToString(), LanguageManager.GetString("title_error"));
}
}

protected override void OnExit(ExitEventArgs e)
Expand Down

0 comments on commit 8814db2

Please sign in to comment.