public override Device RemoveDevice() { var removedDevice = ZWaveController.RemoveDevice(); Device result; if (Devices.Contains(removedDevice)) { result = Devices[removedDevice]; Devices.Remove(result); } else { result = new ZWaveDevice(null, removedDevice); } return(result); }