Exemplo n.º 1
0
 public void WinFromLog(string log)
 {
     if (MainTextBox.InvokeRequired)
     {
         Action <string> actionDelegate = (x) =>
         {
             MainTextBox.AppendText(Environment.NewLine);
             MainTextBox.AppendText(x.ToString());
             MainTextBox.AppendText(Environment.NewLine);
             MainTextBox.ScrollToCaret();
         };
         MainTextBox.Invoke(actionDelegate, log);
     }
     else
     {
         try
         {
             MainTextBox.AppendText(log);
             MainTextBox.AppendText(Environment.NewLine);
             MainTextBox.AppendText(Environment.NewLine);
             MainTextBox.ScrollToCaret();
         }
         catch (Exception)
         {
             return;
         }
     }
 }