Exemplo n.º 1
0
 private void runToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     try
     {
         if (isEditorMode)
         {
             if (isOutputShow)
             {
                 op.Activate();
             }
             else
             {
                 isOutputShow = true;
                 op           = new Output();
                 op.Show();
             }
             run(MainrichTextBox.Text, sender, e, op.OutputrichTextBox);
         }
         else
         {
             run(MainrichTextBox.Lines[line - 1], sender, e);
         }
     }
     catch (IndexOutOfRangeException)
     {
     }
     catch (Exception er)
     {
         MainrichTextBox.AppendText("\n" + er.Message);
     }
 }
Exemplo n.º 2
0
 private void MainrichTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     view(e);
     try
     {
         if (isEditorMode)
         {
             if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Enter)
             {
                 if (isOutputShow)
                 {
                     op.Activate();
                 }
                 else
                 {
                     isOutputShow = true;
                     op           = new Output();
                     op.Show();
                 }
                 run(MainrichTextBox.Text, sender, e, op.OutputrichTextBox);
             }
         }
         else
         {
             if (e.KeyCode == Keys.Enter)
             {
                 run(MainrichTextBox.Lines[line - 1], sender, e);
             }
         }
     }
     catch (IndexOutOfRangeException)
     {
     }
     catch (Exception er)
     {
         MainrichTextBox.AppendText("\n" + er.Message);
     }
 }