示例#1
0
 protected void OnDeviceLost(SatIpDeviceLostArgs args)
 {
     if (DeviceLost != null)
     {
         DeviceLost(this, args);
     }
 }
        private void DeviceLost(object sender, SatIpDeviceLostArgs args)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker) delegate { DeviceLost(sender, args); });
                return;
            }

            //Logger.Info("Device with UUID :{0} restarts,and will removed from the Devices Tree", args.Uuid);
            if (treeView1.Nodes[0].Nodes.ContainsKey(args.Uuid))
            {
                var tn = treeView1.Nodes[0].Nodes[args.Uuid];
                treeView1.Nodes[0].Nodes.Remove(tn);
                treeView1.Update();
            }
        }