Chr
2024-08-20 45c004d4bb5a6f73843a8e8020523f4df14a14e4
PdmAlert/App.xaml.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;
namespace PdmAlert
{
@@ -14,16 +8,27 @@
    public partial class App : Application
    {
        DockApp dockApp;
        LoginWindow loginWindow;
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.ShutdownMode = ShutdownMode.OnExplicitShutdown;
            dockApp.Run();
            if (LoginUser.TryAutoLogin())
            {
                dockApp = new DockApp();
                dockApp.Run();
            }
            else
            {
                loginWindow = new LoginWindow();
                loginWindow.Show();
            }
        }
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            dockApp = new DockApp();
        }
    }
}