Пример #1
0
 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 });
     }
 }
Пример #2
0
        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);
            }
        }