public void HideContextMenu() { if (ContextMenu == null) { return; } Widgets.Remove(ContextMenu); ContextMenu.Visible = false; ContextMenuClosed.Invoke(ContextMenu); ContextMenu = null; if (_previousKeyboardFocus != null) { FocusedKeyboardWidget = _previousKeyboardFocus; _previousKeyboardFocus = null; } if (_previousMouseWheelFocus != null) { FocusedMouseWheelWidget = _previousMouseWheelFocus; _previousMouseWheelFocus = null; } }
/// <summary> /// The options popup menu has been closed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OptionsMenu_Closed(object sender, ToolStripDropDownClosedEventArgs e) { Parent.OptionsMenu.Closed -= OptionsMenu_Closed; ContextMenuClosed?.Invoke(this, EventArgs.Empty); }