Exemple #1
0
        private void DeviceLocator_DeviceAvailable(object sender, DeviceAvailableEventArgs e)
        {
            try
            {
                var device     = e.DiscoveredDevice;
                var infoDevice = device.GetDeviceInfo().ConfigureAwait(false).GetAwaiter().GetResult();

                var objs = new List <object> {
                    device, infoDevice
                };
                var foundDevice = auow.BuildObject <FoundDevice, List <object> >(objs);

                FoundDeviceCollection.Add(foundDevice);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #2
0
 private void DeviceLocator_DeviceAvailable(object sender, DeviceAvailableEventArgs e)
 {
     try
     {
         var info    = e.DiscoveredDevice.GetDeviceInfo().GetAwaiter().GetResult();
         var objects = new List <object> {
             e.DiscoveredDevice, info
         };
         var device = Uow.BuildObject <FoundDevice, List <object> >(objects);
         Uow.Commit(device);
     }
     catch (TaskCanceledException)
     {
     }
     catch (HttpRequestException)
     {
     }
 }