Ejemplo n.º 1
0
 private void Manager_DeviceDropped(object sender, AllJoynClientLib.Devices.DeviceClient e)
 {
     ExecuteOnUIThread(() =>
     {
         clients.Remove(e);
         DeviceDropped?.Invoke(this, e);
     });
 }
Ejemplo n.º 2
0
        private void Provider_ServiceDropped(DeviceProviders.IProvider sender, DeviceProviders.ServiceDroppedEventArgs args)
        {
            var svc = args.Service.Name;

            DeviceClient[] clients = null;
            lock (devicesLock)
            {
                if (devices.ContainsKey(svc))
                {
                    clients = devices[svc];
                    devices.Remove(svc);
                }
            }
            if (clients != null)
            {
                foreach (var client in clients)
                {
                    client.DeviceLost();
                    DeviceDropped?.Invoke(this, client);
                }
            }
        }
Ejemplo n.º 3
0
        private void Provider_ServiceDropped(DeviceProviders.IProvider sender, DeviceProviders.ServiceDroppedEventArgs args)
        {
            var svc = args.Service.Name;

            System.Diagnostics.Debug.WriteLine($"Service Joined: {svc ?? "<UNKNOWN>"}");
            DeviceClient[] clients = null;
            lock (devicesLock)
            {
                if (devices.ContainsKey(svc))
                {
                    clients = devices[svc];
                    devices.Remove(svc);
                }
            }

            if (clients != null)
            {
                foreach (var client in clients)
                {
                    client.ServiceDropped();
                    DeviceDropped?.Invoke(this, client);
                }
            }
        }