Пример #1
0
 private void InvokeProgress(string text)
 {
     try
     {
         if (InvokeRequired)
         {
             this.Invoke(new Action <string>((arg) =>
             {
                 txtErrorLog.AppendText(arg.ToString() + "\r\n");
                 LogFactory.WriteLine(_log, arg.ToString());
                 if (arg.ToString().Contains("处理结束"))
                 {
                     btnOK.Enabled = true;
                 }
             }), text);
         }
         else
         {
             txtErrorLog.AppendText(text.ToString() + "\r\n");
             LogFactory.WriteLine(_log, text.ToString());
             if (text.Contains("处理结束"))
             {
                 btnOK.Enabled = true;
             }
         }
     }
     catch (System.Exception ex)
     {
         LogFactory.WriteLine(_log, ex.Message);
         return;
     }
 }
Пример #2
0
 private void InvokeProgress(string text)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <string>((arg) =>
         {
             txtErrorLog.AppendText(arg.ToString() + "\r\n");
         }), text);
     }
     else
     {
         txtErrorLog.AppendText(text.ToString() + "\r\n");
     }
 }