Exemplo n.º 1
0
        public static void Dispose()
        {
            SystemEvents.DisplaySettingsChanged -= SystemEventsOnDisplaySettingsChanged;

            App.BaseDispatcher.Invoke(() =>
            {
                FocusManager.Dispose();
                TrayIcon?.Dispose();

                foreach (Window w in Application.Current.Windows)
                {
                    if (w is TccWidget)
                    {
                        continue;
                    }
                    try { w.Close(); } catch { }
                }
            });

            ChatWindowManager.Instance.CloseAllWindows();

            try { CharacterWindow.CloseWindowSafe(); } catch { }
            try { CooldownWindow.CloseWindowSafe(); } catch { }
            try { GroupWindow.CloseWindowSafe(); } catch { }
            try { BossWindow.CloseWindowSafe(); } catch { }
            try { BuffWindow.CloseWindowSafe(); } catch { }
            try { ClassWindow.CloseWindowSafe(); } catch { }

            if (RunningDispatchers == null)
            {
                return;
            }
            var times = 50;

            while (times > 0)
            {
                if (RunningDispatchers.Count == 0)
                {
                    break;
                }
                Log.CW("Waiting all dispatcher to shutdown...");
                Thread.Sleep(100);
                times--;
            }
        }
Exemplo n.º 2
0
        //private static void TccWindow_RecreateWindow(TccWindow obj)
        //{
        //    if (obj is CooldownWindow) CooldownWindow = new CooldownWindow();
        //    if (obj is GroupWindow) GroupWindow = new GroupWindow();
        //    if (obj is BossWindow) BossWindow = new BossWindow();
        //    if (obj is BuffWindow) BuffWindow = new BuffWindow();
        //    if (obj is CharacterWindow) CharacterWindow = new CharacterWindow();
        //    if (obj is ClassWindow) ClassWindow = new ClassWindow();
        //    if (obj is ChatWindow) ChatWindowManager.Instance.InitWindows();
        //}

        //public static void NotifyDimChanged()
        //{
        //    TccDimChanged?.Invoke(null, new PropertyChangedEventArgs(nameof(IsTccDim)));
        //}
        //public static void NotifyVisibilityChanged()
        //{
        //    TccVisibilityChanged?.Invoke(null, new PropertyChangedEventArgs(nameof(IsTccVisible)));
        //}
        //public static void RefreshDim()
        //{
        //    SkillsEnded = false;
        //    Task.Delay(100).ContinueWith(t => SkillsEnded = true);
        //}
        public static void Dispose()
        {
            FocusManager.Dispose();
            TrayIcon?.Dispose();


            foreach (Window w in Application.Current.Windows)
            {
                try { w.Close(); } catch { }
            }

            try { CharacterWindow.CloseWindowSafe(); } catch { }
            try { CooldownWindow.CloseWindowSafe(); } catch { }
            try { GroupWindow.CloseWindowSafe(); } catch { }
            try { BossWindow.CloseWindowSafe(); } catch { }
            try { BuffWindow.CloseWindowSafe(); } catch { }
            try { InfoWindow.Close(); } catch { }
            //try { ChatWindow.CloseWindowSafe(); } catch { }
            ChatWindowManager.Instance.CloseAllWindows();
            try { ClassWindow.CloseWindowSafe(); } catch { }
        }