示例#1
0
 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;
     }
 }
示例#2
0
 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();
 }
示例#3
0
 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();
     }
 }
示例#4
0
        public void ResetProgram()
        {
            int test = new int();

            AttemptStop();
            ErrorTextBox.Clear();
            OutputTextBox.Clear();
            Interpret.Reset();
            Settings.CanReset = false;
            SetRunToRun();
            SetOptionsToOptions();
            EnableEdit();
            PixelGridUI.NewGrid();
        }
示例#5
0
 private void IteratorDone(object sender, RunWorkerCompletedEventArgs e)
 {
     if (Settings.IterationType == "Delay")
     {
         if (Settings.Running)
         {
             Interpret.IterateOnce();
             Iterator.RunWorkerAsync();
         }
         else
         {
             SetRunToReset();
             SetOptionsToOptions();
         }
     }
 }
示例#6
0
 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();
     }
 }
示例#7
0
 private void RunFullWait(object sender, DoWorkEventArgs e)
 {
     Interpret.FullRun();
 }