public SlaveDevice AddSlaveDevice(byte id) { var slave = new SlaveDevice(id, this); SlaveDevices.Add(slave); return(slave); }
private void UpdateDevicesCollection(IEnumerable <Device> newDevices) { if (newDevices != null && newDevices.Any()) { var toBeAdds = newDevices.Except(_slaveDevices, new DeviceEqualityComparer <Device>()); if (toBeAdds.Any()) { DispatcherHelper.UIDispatcher.Invoke(() => { foreach (var device in toBeAdds) { SlaveDevices.Add(device); } }); } } }