示例#1
0
 void api_LogEvent(object sender, LogEventArgs e)
 {
     textBox4.Text += e.Message + Environment.NewLine;
     //move the caret to the end of the text
     textBox4.SelectionStart = textBox4.TextLength;
     //scroll to the caret
     textBox4.ScrollToCaret();
 }
示例#2
0
 private void OnLogMessage(string message)
 {
     EventHandler<LogEventArgs> temp = this.LogEvent;
     if (temp != null)
     {
         LogEventArgs ea = new LogEventArgs(message);
         Delegate[] il = temp.GetInvocationList();
         if (il != null)
             foreach (EventHandler<LogEventArgs> dgt in il)
                 dgt.Invoke(this, ea);
     }
 }