예제 #1
0
        private async void Application_Startup(object sender, StartupEventArgs e)
        {
            DispatcherHelper.Initialize();
            MapsterConfig.Configure();
#if DEBUG
            AllocConsole();
#endif

            Current.DispatcherUnhandledException       += App_OnDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            bool createdNew = false;
            instanceMutex = new Mutex(true, "{4D4BF0F8-27FF-47DF-BC62-FA17DBE003D8}", out createdNew);
            if (createdNew)
            {
#if ENABLE_AUTHORIZATION_CHECK
                Logger.Debug("RPARobot启动(带授权检测版本)……", logger);
#else
                Logger.Debug("RPARobot启动(无授权检测版本)……", logger);
#endif

                UiElement.Init();

                initLocalRPAStudioDir();
                initLogsDir();
                initConfigDir();
                JobScheduler = await QuartzHelper.InitSchedulerAsync();

                await JobScheduler.Start();
            }
            else
            {
                Environment.Exit(0);
            }
        }