Exemplo n.º 1
0
 public void log(string line, string what = "UNDEF")
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke(new logHandler(log), what, line);
     }
     else
     {
         LogTextbox.Text          += String.Format("[{0}] {1}\r\n", line, what);
         LogTextbox.SelectionStart = LogTextbox.Text.Length;
         LogTextbox.ScrollToCaret();
     }
 }
Exemplo n.º 2
0
 public void AppendLog(string message)
 {
     if (LogTextbox.InvokeRequired)
     {
         while (!LogTextbox.IsHandleCreated)
         {
             if (LogTextbox.Disposing || LogTextbox.IsDisposed)
             {
                 return;
             }
         }
         AppendLogCallback d = new AppendLogCallback(AppendLog);
         LogTextbox.Invoke(d, new object[] { message });
     }
     else
     {
         LogTextbox.Text          += "\r\n" + message;
         LogTextbox.SelectionStart = LogTextbox.TextLength;
         LogTextbox.ScrollToCaret();
     }
 }