public override void OnFound(string Endpoint, ScanEndpointInfo scanEndpointInfo) { Device device = MainActivity.FindDevice(Endpoint); if (device == null) { device = new Device(scanEndpointInfo.Name, Endpoint, false); MainActivity.AvaliableDevicesList.Add(device); Log.Debug(MainActivity.TAG, "OnFound : " + Endpoint); context.UpdateAvaliableDevices(); } }
public override void OnDisconnected(string EndPoint) { Log.Debug(MainActivity.TAG, "OnDisconnected with Endpoint : " + EndPoint); Toast.MakeText(context, EndPoint + " Disconnected ", ToastLength.Long).Show(); Device device = MainActivity.FindDevice(EndPoint); if (device != null) { device.Status = false; } context.UpdateAvaliableDevices(); NearbyConnection.AvalibleDeviceslistview.CollapseGroup(MainActivity.AvaliableDevicesList.IndexOf(device)); }