Beispiel #1
0
 private void EventDeviceRemoved(object sender, DeviceList.EventArgsDevice e)
 {
     if (e.Device.Name == iFriendlyName)
     {
         lock (this)
         {
             iAction.EventResponse -= EventResponse;
             iAction  = null;
             iService = null;
             iThread  = null;
         }
     }
 }
Beispiel #2
0
        private void EventDeviceAdded(object sender, DeviceList.EventArgsDevice e)
        {
            if (e.Device.Name == iFriendlyName)
            {
                lock (this)
                {
                    iService = new ServiceProduct(e.Device);
                    iAction  = iService.CreateAsyncActionProduct();
                    iAction.EventResponse += EventResponse;

                    iThread              = new Thread(Run);
                    iThread.Name         = "TestRunner";
                    iThread.IsBackground = true;
                    iThread.Start();
                }
            }
        }