// do validation of the current working-on state machine public void startOrStopValidation() { if (scriptsTabControl.TabCount <= 0 || ModelManager.CurrentSelectedScriptIndex < 0) { return; } // stop the validation if (SimulationManager.isSimulating()) { SimulationManager.stopSimulation(); } // start a validation else { DialogResult dialogResult = new TypingForm("Pre-set branches", "Please enter the input sequence.\r\n\r\nEach input must be seperated by a single \',\'", false).ShowDialog(); if (dialogResult == DialogResult.OK) { // start the simulation w/ the type of VALIDATION SimulationManager.startSimulation( SimulationType.VALIDATION, TypingForm.userTypedResultText.Split(',').ToList() ); } } }
// do renaming the script private void renameScript() { DialogResult result = new TypingForm("Rename the script", "Type the new title for your script.", false).ShowDialog(); if (result == DialogResult.OK) { ModelManager.renameScript(TypingForm.userTypedResultText, false); mTabControl.SelectedTab.Text = TypingForm.userTypedResultText + "*"; } }
// prompt the typing form to get some texts from user private string promptTypingFormAndGetTypedText() { // don't prompt the typing form up, return empty string (not null) directly if (SettingsManager.PromptTypingFormWhenCreatingNewGeneralState == false) { return(""); } // prompt new typing-form TypingForm stateContentForm = new TypingForm("New State", "Please enter the content of the new state", true); // show and get the dialog-result DialogResult dialogResult = stateContentForm.ShowDialog(); if (dialogResult == DialogResult.Cancel) { return(null); } else { return(TypingForm.userTypedResultText); } }