Exemple #1
0
 private async void DeviceWatcher_Added(DeviceWatcher sender, DeviceInformation args)
 {
     await coreDispatcher.RunAsync(
         CoreDispatcherPriority.Normal,
         () =>
     {
         FoundDeviceList.Add(args);
         DeviceClassWatcherCallbackRoutine.ListUpdate(coreDispatcher, DeviceClassWatcherCallbackRoutine.ListOperation.Add, DeviceClass, args);
     });
 }
Exemple #2
0
 private async void DeviceWatcher_Updated(DeviceWatcher sender, DeviceInformationUpdate args)
 {
     await coreDispatcher.RunAsync(
         CoreDispatcherPriority.Normal,
         () =>
     {
         for (int index = 0; index < FoundDeviceList.Count; ++index)
         {
             if (FoundDeviceList[index].Id == args.Id)
             {
                 FoundDeviceList[index].Update(args);
                 DeviceClassWatcherCallbackRoutine.ListUpdate(coreDispatcher, DeviceClassWatcherCallbackRoutine.ListOperation.Update, DeviceClass, null, args.Id);
                 break;
             }
         }
     });
 }