public void disconect(List <DeviceListItem> deviceList) { try { // Find a device and temporarily connect. foreach (var dev in deviceList) { Smc device = new Smc(dev); device.disconnect(); } } catch (Exception error) // Handle exceptions by displaying them to the user. { Console.WriteLine(error.Message); } }