static void hotKeyManager_HotKeyPressed(object sender, SmartHotKey.HotKeyEventArgs e) { switch (e.HotKey) { case "Control+Shift+S": ToggleSaveLayoutOnClose(e); return; case "Control+Shift+D": ToggleDockingEnabled(e); return; default: return; } }
private static void ShowToggleMessage(SmartHotKey.HotKeyEventArgs e, string variable, bool value) { MessageBox.Show(variable + " = " + value + ".\n\rToggle using " + e.HotKey + "."); }
private static void ToggleSaveLayoutOnClose(SmartHotKey.HotKeyEventArgs e) { RiskApps3.Controllers.SessionManager.Instance.SaveLayoutOnClose = !RiskApps3.Controllers.SessionManager.Instance.SaveLayoutOnClose; ShowToggleMessage(e, "SaveLayoutOnClose", RiskApps3.Controllers.SessionManager.Instance.SaveLayoutOnClose); }
private static void ToggleDockingEnabled(SmartHotKey.HotKeyEventArgs e) { RiskApps3.Controllers.SessionManager.Instance.AllowDockDragAndDrop = !RiskApps3.Controllers.SessionManager.Instance.AllowDockDragAndDrop; ShowToggleMessage(e, "AllowDockDragAndDrop", RiskApps3.Controllers.SessionManager.Instance.AllowDockDragAndDrop); }