예제 #1
0
        private static void LoadBossGaugeWindow()
        {
            var bossGaugeThread = new Thread(new ThreadStart(() =>
            {
                SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
                BossWindow = new BossWindow();

                //BossWindow.AllowsTransparency = SettingsManager.BossWindowSettings.AllowTransparency;
                BossWindow.Show();
                waiting = false;

                Dispatcher.Run();
            }));

            bossGaugeThread.Name = "Boss gauge thread";
            bossGaugeThread.SetApartmentState(ApartmentState.STA);
            bossGaugeThread.Start();
            Debug.WriteLine("Boss window loaded");
        }
예제 #2
0
        private static void LoadNpcWindow()
        {
            var bossGaugeThread = new Thread(() =>
            {
                SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
                BossWindow = new BossWindow();
                if (BossWindow.WindowSettings.Enabled)
                {
                    BossWindow.Show();
                }
                AddDispatcher(Thread.CurrentThread.ManagedThreadId, Dispatcher.CurrentDispatcher);
                Dispatcher.Run();
                RemoveDispatcher(Thread.CurrentThread.ManagedThreadId);
            })
            {
                Name = "Boss"
            };

            bossGaugeThread.SetApartmentState(ApartmentState.STA);
            bossGaugeThread.Start();
        }