protected override void Dispose(bool disposing) { Microsoft.Win32.SystemEvents.DisplaySettingsChanged -= SystemEvents_DisplaySettingsChanged; PluginManager.Instance.Dispose(); TasktrayIcon.HideNotifyIcon(); System.Threading.Thread.Sleep(500); base.Dispose(disposing); }
public void OnLanguageChanged() { Settings.Culture = Language.Id; DefaultLocalizer.SwitchLanguage(Language); LocalizeKeybindsText(); UIAssistantAPI.Instance.PluginManager.Localize(); TasktrayIcon.HideNotifyIcon(); TasktrayIcon.ShowNotifyIcon(); }
public void Initialize() { IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; NativeMethods.SetWindowExTransparent(windowHandle); Left = SystemParameters.VirtualScreenLeft; Top = SystemParameters.VirtualScreenTop; Width = SystemParameters.VirtualScreenWidth; Height = SystemParameters.VirtualScreenHeight; Microsoft.Win32.SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged; var api = UIAssistantAPI.Instance; api.Initialize(DefaultHUDPanel, DefaultContextPanel); api.ThemeAPI.SwitchTheme(api.UIAssistantSettings.Theme); api.ViewAPI.TopMost = false; Hotkey.RegisterHotkeys(); TasktrayIcon.ShowNotifyIcon(); }
private void HandleUnhandledException(Exception ex) { try { PluginManager.Instance.Dispose(); TasktrayIcon.HideNotifyIcon(); } catch { } try { ShowMessage(ex); Log.Fatal(ex); } catch { } Environment.Exit(1); }