public void It_should_trigger_the_Exit_action() { var triggered = false; var actionUpdate = new ActionExit((action) => triggered = true); actionUpdate.Exit(); Assert.IsTrue(triggered); }
private void DrawAddButton() { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("+")) { rows[""] = new ActionExit("", ""); } GUILayout.EndHorizontal(); }
/// <summary> /// Processes the command key. /// </summary> /// <seealso cref="M:System.Windows.Forms.Form.ProcessCmdKey(Message@,Keys)"/> protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (Globals.IsReady) { switch (keyData) { // Top menu system case Keys.Alt | Keys.S: ActionSettings.ShowDropDown(); return(true); case Keys.Alt | Keys.I: ActionInformation.ShowDropDown(); return(true); case Keys.F9: ActionPreferences.PerformClick(); return(true); case Keys.Alt | Keys.Control | Keys.F4: ActionExit.PerformClick(); return(true); case Keys.Escape: if (!EditESCtoExit.Checked || EditMeanings.IsCurrentCellInEditMode) { break; } ActionExit.PerformClick(); return(true); // Rotate view case Keys.Control | Keys.Shift | Keys.Tab: if (Globals.AllowClose) { SetView(Settings.CurrentView.Previous(ViewMode.Notebook));// TODO notebook remove when ready } return(true); case Keys.Control | Keys.Tab: if (Globals.AllowClose) { SetView(Settings.CurrentView.Next(ViewMode.Notebook));// TODO notebook remove when ready } return(true); // Change view case Keys.F1: ActionViewAnalysis.PerformClick(); return(true); case Keys.F2: ActionViewLetters.PerformClick(); return(true); case Keys.F3: if (!Globals.IsDebugExecutable) { break; // TODO remove when ready } ActionViewNotebook.PerformClick(); return(true); // Application functions case Keys.F5: case Keys.Control | Keys.F: ActionSearchTerm.PerformClick(); return(true); case Keys.Control | Keys.N: ActionNewInstance.PerformClick(); return(true); // Top menu system case Keys.Alt | Keys.T: ActionTools.ShowDropDown(); return(true); case Keys.Alt | Keys.L: if (ActionWebLinks.Enabled) { ActionWebLinks.ShowDropDown(); } return(true); // Data edition case Keys.Control | Keys.S: ActionSave.PerformClick(); return(true); case Keys.Control | Keys.Back: ActionUndo.Focus(); ActionUndo.PerformClick(); return(true); } } // Letters navigation if (Globals.AllowClose && Settings.CurrentView == ViewMode.Letters) { switch (keyData) { case Keys.Control | Keys.Home: LettersNavigator.ActionFirst.PerformClick(); return(true); case Keys.Control | Keys.End: LettersNavigator.ActionLast.PerformClick(); return(true); case Keys.Control | Keys.PageUp: LettersNavigator.ActionPrevious.PerformClick(); return(true); case Keys.Control | Keys.PageDown: LettersNavigator.ActionNext.PerformClick(); return(true); } } return(base.ProcessCmdKey(ref msg, keyData)); }
void DrawActionExit(ActionExit actionExit) { GUILayout.TextField(actionExit.action); //GUILayout.TextField(actionExit.exit); }
public FSMStateModel() { rows = new Dictionary <string, ActionExit>(); defaultExit = new ActionExit("", ""); }