// </SnippetBuildDeviceList>

        // <SnippetEventHandlers>
        private void RemoteSystemWatcher_RemoteSystemRemoved(
            RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            if (m_deviceMap.ContainsKey(args.RemoteSystemId))
            {
                m_deviceList.Remove(m_deviceMap[args.RemoteSystemId]);
                m_deviceMap.Remove(args.RemoteSystemId);
            }
        }
Exemple #2
0
        private static void _watcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            // Remove all remote systems with matching Ids
            RemoteSystemList.RemoveAll(d => d.Id == args.RemoteSystemId);
            Events.TrackEvent(Events.RemoteSystemRemoved);

            DebugWrite("RemoteSystemRemove: " + args.RemoteSystemId);
            OnRemoteDeviceRemoved?.Invoke(null, args.RemoteSystemId);
        }
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     if (deviceMap.ContainsKey(args.RemoteSystemId))
     {
         await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
             () => Devices.Remove(deviceMap[args.RemoteSystemId]));
         deviceMap.Remove(args.RemoteSystemId);
     }
 }
        private void DevicesWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            var updateTask = dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                var existDevice = devicesList.Where(x => x.Id == args.RemoteSystemId).FirstOrDefault();

                if (existDevice != null)
                {
                    devicesList.Remove(existDevice);
                }
            });
        }
Exemple #5
0
        private void RemoteSystemRemoved(RemoteSystemWatcher watcher, RemoteSystemRemovedEventArgs args)
        {
            MainActivity.RunOnUiThread(delegate
            {
                var itemToRemove = (from item in RemoteSystems
                                    where item.Id == args.P0
                                    select item).FirstOrDefault();

                if (itemToRemove != null)
                {
                    RemoteSystems.Remove(itemToRemove);
                }
            });
        }
        private void OnWatcherRemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            int target = -1;

            for (int i = 0; i < RemoteSystems.Count; i++)
            {
                if (RemoteSystems[i].Id == args.RemoteSystemId)
                {
                    target = i;
                    break;
                }
            }

            if (target >= 0)
            {
                DispatcherHelper.UIDispatcher.RunIdleAsync(_ =>
                {
                    RemoteSystems.RemoveAt(target);
                });
            }
        }
 private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     systemList.Remove(systemList.First(x => x.Id == args.RemoteSystemId));
     RemoteSystemsListUpdated?.Invoke(this, EventArgs.Empty);
 }
Exemple #8
0
 private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher watcher, RemoteSystemRemovedEventArgs args)
 {
     RunOnUiThread(() =>
                   _adapter.Remove(_adapter.Items.FirstOrDefault(system => system.Id == args.P0))
                   );
 }
Exemple #9
0
        private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            var device = m_deviceList.Find(a => a.Id == args.RemoteSystemId);

            if (device != null)
            {
                m_deviceList.Remove(device);
            }
        }
Exemple #10
0
 private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     if (listCompanionDevices != null)
     {
         if (listCompanionDevices.ContainsKey(args.RemoteSystemId))
         {
             CompanionDevice d = listCompanionDevices[args.RemoteSystemId];
             OnDeviceRemoved(this, d);
             listCompanionDevices.Remove(args.RemoteSystemId);
         }
     }
     if (listRemoteSystems != null)
     {
         if (listRemoteSystems.ContainsKey(args.RemoteSystemId))
         {
             listRemoteSystems.Remove(args.RemoteSystemId);
         }
     }
 }
Exemple #11
0
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await DispatcherHelper.ExecuteOnUIThreadAsync(() =>
     {
         RemoteSystems.Remove(RemoteSystems.FirstOrDefault(rs => rs.Id == args.RemoteSystemId));
     });
 }
Exemple #12
0
        private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher watcher, RemoteSystemRemovedEventArgs args)
        {
            var remoteSystem = RemoteSystems.Where(s => s.Id == args.P0).FirstOrDefault();

            if (remoteSystem != null)
            {
                RemoteSystems.Remove(remoteSystem);
            }
        }
Exemple #13
0
        private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher watcher, RemoteSystemRemovedEventArgs args)
        {
            _remoteSystems.RemoveAll(system => system.Id == args.P0);

            RunOnUiThread(() => _adapter.Remove(args.P0));
        }
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     if (DeviceList != null)
     {
         await Windows.ApplicationModel.Core.CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
         {
             var item = DeviceList.Where(q => q.UniqueId == args.RemoteSystemId).FirstOrDefault();
             if (item != null)
             {
                 DeviceList.Remove(item);
             }
             RaisePropertyChanged("ShowEmptyErrorMessage");
         });
     }
 }
Exemple #15
0
 private static void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     remoteSystems.RemoveAll(x => x.Id == args.RemoteSystemId);
     updateSystems();
 }
 private async void M_remoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => RemoteSystems.Remove(RemoteSystems.First(rs => rs.Id == args.RemoteSystemId)));
 }
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         _progressRing.IsActive = true;
         if (DeviceMap.ContainsKey(args.RemoteSystemId))
         {
             RemoteSystems.Remove(DeviceMap[args.RemoteSystemId]);
             DeviceMap.Remove(args.RemoteSystemId);
         }
     });
 }
Exemple #18
0
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await DispatcherEx.RunOnCoreDispatcherIfPossible(() =>
     {
         var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystemId).FirstOrDefault();
         if (remoteSystem != null)
         {
             _remoteSystems.Remove(remoteSystem);
         }
     });
 }
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         RemoteSystems.Remove(RemoteSystems.FirstOrDefault(rs => rs.Id == args.RemoteSystemId));
     });
 }
Exemple #20
0
        private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystemId).FirstOrDefault();

            if (remoteSystem != null)
            {
                _remoteSystems.Remove(remoteSystem);
            }

            var system = _availableRemoteSystems.Where(s => s.RemoteSystem.Id == args.RemoteSystemId).FirstOrDefault();

            if (system != null)
            {
                var t = Helpers.RunOnCoreDispatcherIfPossible(() =>
                {
                    _availableRemoteSystems.Remove(system);
                    RemoteSystemRemoved?.Invoke(this, system);
                });
            }
        }
Exemple #21
0
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await DispatcherQueue.EnqueueAsync(() =>
     {
         RemoteSystems.Remove(RemoteSystems.First(a => a.Id == args.RemoteSystemId));
     });
 }
 private async void Watcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => Devices.Remove(Devices.First(x => x.Id == args.RemoteSystemId)));
 }
        private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
        {
            if (deviceMap.ContainsKey(args.RemoteSystemId))
            {
                await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                                                            () => Devices.Remove(deviceMap[args.RemoteSystemId]));

                deviceMap.Remove(args.RemoteSystemId);
            }
        }
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         if (m_rootPage.deviceMap.ContainsKey(args.RemoteSystemId))
         {
             m_rootPage.deviceList.Remove(m_rootPage.deviceMap[args.RemoteSystemId]);
             UpdateStatus(m_rootPage.deviceMap[args.RemoteSystemId].DisplayName + " removed.", NotifyType.StatusMessage);
             m_rootPage.deviceMap.Remove(args.RemoteSystemId);
         }
     });
 }
Exemple #25
0
 private async void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         if (m_rootPage.systemMap.ContainsKey(args.RemoteSystemId))
         {
             m_rootPage.systemList.Remove(m_rootPage.systemMap[args.RemoteSystemId]);
             UpdateStatus(m_rootPage.systemMap[args.RemoteSystemId].DisplayName + " removed.", NotifyType.StatusMessage);
             m_rootPage.systemMap.Remove(args.RemoteSystemId);
         }
     });
 }
 private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher watcher, RemoteSystemRemovedEventArgs args)
 {
     System.Diagnostics.Debug.WriteLine("KNOWZY: RemoteSystemRemoved " + args.P0);
     remoteSystems.RemoveAll(system => system.Id == args.P0);
     RemoteSystemRemoved?.Invoke(this, args);
 }