private void RunButton_Click(object sender, RoutedEventArgs e) { if (Settings.RunFunction == Settings.RunFunctionMap["Run"]) { if (CanRun()) { RunProgram(); return; } } if (Settings.RunFunction == Settings.RunFunctionMap["Step"]) { if (Settings.Running && Settings.IterationType == "Once") { Interpret.IterateOnce(); return; } } if (Settings.RunFunction == Settings.RunFunctionMap["Stop"]) { AttemptStop(); return; } if (Settings.RunFunction == Settings.RunFunctionMap["Reset"]) { ResetProgram(); return; } }
private void RunFullDone(object sender, RunWorkerCompletedEventArgs e) { Settings.Running = false; ErrorTextBox.Text = Interpret.Output.RunFullErrorOutput; OutputTextBox.Text = Interpret.Output.RunFullOutput; OutputTextBox.ScrollToEnd(); Interpret.UpdateRegisterUI(); SetRunToReset(); SetOptionsToOptions(); }
private void RunFullUpdateDone(object sender, RunWorkerCompletedEventArgs e) { if (Settings.Running) { ErrorTextBox.Text = Interpret.Output.RunFullErrorOutput; OutputTextBox.Text = Interpret.Output.RunFullOutput; OutputTextBox.ScrollToEnd(); Interpret.UpdateRegisterUI(); RunFullUpdate.RunWorkerAsync(); } }
public void ResetProgram() { int test = new int(); AttemptStop(); ErrorTextBox.Clear(); OutputTextBox.Clear(); Interpret.Reset(); Settings.CanReset = false; SetRunToRun(); SetOptionsToOptions(); EnableEdit(); PixelGridUI.NewGrid(); }
private void IteratorDone(object sender, RunWorkerCompletedEventArgs e) { if (Settings.IterationType == "Delay") { if (Settings.Running) { Interpret.IterateOnce(); Iterator.RunWorkerAsync(); } else { SetRunToReset(); SetOptionsToOptions(); } } }
public void RunProgram() { if (!Settings.Running) { Interpret.ProgramInput(EditorTextBox.Text); DisableEdit(); } if (Settings.IterationType == "Delay") { Settings.CanReset = true; Settings.Running = true; SetRunToStop(); Iterator.RunWorkerAsync(); } if (Settings.IterationType == "Once") { Settings.CanReset = true; Settings.Running = true; SetRunToStep(); SetOptionsToReset(); Settings.RunFunction = Settings.RunFunctionMap["Step"]; Interpret.IterateOnce(); } if (Settings.IterationType == "End") { Settings.CanReset = true; Settings.Running = true; SetRunToStop(); RunFull.RunWorkerAsync(); RunFullUpdate.RunWorkerAsync(); RunButton.Background = new SolidColorBrush(); } if (Settings.IterationType == "Label") { Interpret.Break.BreakLabel = Settings.BreakLabel; Interpret.Break.BreakOnLabel = true; Settings.CanReset = true; Settings.Running = true; SetRunToStop(); RunFull.RunWorkerAsync(); RunFullUpdate.RunWorkerAsync(); RunButton.Background = new SolidColorBrush(); } }
private void RunFullWait(object sender, DoWorkEventArgs e) { Interpret.FullRun(); }