Cross-Thread exception handled

Cross-Thread exception  on Uninstall
This commit is contained in:
Abdullah Saleem 2015-04-06 22:12:56 +05:00
parent 860b59ac7d
commit 46bd17c4fa
1 changed files with 20 additions and 19 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using xServer.Core.Helper;
@ -71,19 +72,19 @@ namespace xServer.Core.Commands
public static void HandleStatus(Client client, Status packet)
{
new Thread(() =>
{
FrmMain.Instance.Invoke((MethodInvoker) delegate
{
foreach (ListViewItem lvi in FrmMain.Instance.lstClients.Items)
{
Client c = (Client) lvi.Tag;
if (client == c)
{
FrmMain.Instance.Invoke((MethodInvoker)delegate
{
lvi.SubItems[3].Text = packet.Message;
});
break;
}
}
});
}).Start();
}