private void SlaveDisconnected(object sender, SlaveEventArgs slaveEventArgs) { slaveEventArgs.Slave.SlaveInfoUpdated += SlaveInfoUpdated; listViewSlaves.Invoke((MethodInvoker)(() => { ListViewItem toRemove; if ((toRemove = listViewSlaves.Items.Cast <ListViewItem>().FirstOrDefault(item => item.SubItems[1].Text == slaveEventArgs.Slave.Client.ClientHandle.ToString())) != default(ListViewItem)) { listViewSlaves.Items.Remove(toRemove); } })); }
private void SlaveConnected(object sender, SlaveEventArgs slaveEventArgs) { slaveEventArgs.Slave.SlaveInfoUpdated += SlaveInfoUpdated; listViewSlaves.Invoke((MethodInvoker)(() => { listViewSlaves.Items.Add(new ListViewItem(new[] { listViewSlaves.Items.Count.ToString(), slaveEventArgs.Slave.Client.ClientHandle.ToString(), "-", slaveEventArgs.Slave.LocalEndPoint.ToString(), slaveEventArgs.Slave.RemoteEndPoint.ToString(), "-" })); })); }
private void SlaveConnected(object sender, SlaveEventArgs slaveEventArgs) { slaveEventArgs.Slave.SlaveInfoUpdated += SlaveInfoUpdated; listViewSlaves.Invoke((MethodInvoker) (() => { listViewSlaves.Items.Add(new ListViewItem(new[] { listViewSlaves.Items.Count.ToString(), slaveEventArgs.Slave.Client.ClientHandle.ToString(), "-", slaveEventArgs.Slave.LocalEndPoint.ToString(), slaveEventArgs.Slave.RemoteEndPoint.ToString(), "-" })); })); }
private void SlaveInfoUpdated(object sender, SlaveEventArgs slaveEventArgs) { slaveEventArgs.Slave.SlaveInfoUpdated += SlaveInfoUpdated; listViewSlaves.Invoke((MethodInvoker)(() => { ListViewItem toFind; if ( (toFind = listViewSlaves.Items.Cast <ListViewItem>() .FirstOrDefault( item => item.SubItems[1].Text == slaveEventArgs.Slave.Client.ClientHandle.ToString())) != default(ListViewItem)) { toFind.SubItems[2].Text = slaveEventArgs.Slave.OS; toFind.SubItems[5].Text = String.Format("{0}\\\\{1}", slaveEventArgs.Slave.ComputerName, slaveEventArgs.Slave.UserName); } })); }
private void SlaveDisconnected(object sender, SlaveEventArgs slaveEventArgs) { slaveEventArgs.Slave.SlaveInfoUpdated += SlaveInfoUpdated; listViewSlaves.Invoke((MethodInvoker)(() => { ListViewItem toRemove; if ((toRemove = listViewSlaves.Items.Cast<ListViewItem>().FirstOrDefault(item => item.SubItems[1].Text == slaveEventArgs.Slave.Client.ClientHandle.ToString())) != default(ListViewItem)) listViewSlaves.Items.Remove(toRemove); })); }
private void SlaveInfoUpdated(object sender, SlaveEventArgs slaveEventArgs) { slaveEventArgs.Slave.SlaveInfoUpdated += SlaveInfoUpdated; listViewSlaves.Invoke((MethodInvoker)(() => { ListViewItem toFind; if ( (toFind = listViewSlaves.Items.Cast<ListViewItem>() .FirstOrDefault( item => item.SubItems[1].Text == slaveEventArgs.Slave.Client.ClientHandle.ToString())) != default(ListViewItem)) { toFind.SubItems[2].Text = slaveEventArgs.Slave.OS; toFind.SubItems[5].Text = String.Format("{0}\\\\{1}", slaveEventArgs.Slave.ComputerName, slaveEventArgs.Slave.UserName); } })); }