public void updateLogsUI(object sender, UpdateLogsArgs e) { if (this.InvokeRequired == false) { this.Result.AppendText(e.log); this.Result.AppendText("\r\n"); } else { updateLogsHandler updLogs = new updateLogsHandler(updateLogsUI); Invoke(updLogs, new object[] { sender, e }); } }
private void logInfo(string log) { object sender = System.Threading.Thread.CurrentThread; UpdateLogsArgs e; if (form != null) { if (logs.Count > 0) { foreach (string pendingLog in logs) { e = new UpdateLogsArgs(pendingLog); form.updateLogsUI(sender, e); } logs.Clear(); } e = new UpdateLogsArgs(log); form.updateLogsUI(sender, e); } else { logs.Add(log); } }