protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); TrayManager.Init(); TrayManager.NotifyIconInteracted += (ex) => { if (ex.Type == TrayManager.InteractionType.CtxExit) { Application.Current.Shutdown(); return; } if (SettingManager.Get("overlayMode")) { HotkeyPressed(); } else { RestoreWindow(); } }; if (SettingManager.Get("overlayMode")) // Always show and ready to pop { TrayManager.Pop("Press CTRL+SHIFT+HOME to toggle the NexDirect overlay...", "NexDirect (Overlay Mode)"); } }
private void _linkerClipboard(string url) { try { Clipboard.SetText(url); } catch (Exception e) { MessageBox.Show("Error copying link to clipboard:\n\n" + e.ToString()); } TrayManager.Pop("Beatmap link copied to clipboard."); }
protected override void OnClosed(EventArgs e) { if (SettingManager.Get("overlayMode")) { HotkeyManager.Unregister(HotkeyManager.GetRuntimeHandle(this)); // unload hotkey stuff } // unload tray icon to prevent it sticking there TrayManager.Unload(); base.OnClosed(e); }