Пример #1
0
 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);
         }
     }));
 }
Пример #2
0
 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(),
             "-"
         }));
     }));
 }
Пример #3
0
 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(),
             "-"
         }));
     }));
 }
Пример #4
0
 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);
         }
     }));
 }
Пример #5
0
 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);
     }));
 }
Пример #6
0
 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);
         }
     }));
 }