private void AddThermoDevices( XRawFileIO xcaliburAccessor, DatasetFileInfo datasetFileInfo, ICollection <Device> deviceMatchList, ICollection <Device> deviceSkipList) { // ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator foreach (var device in xcaliburAccessor.FileInfo.Devices) { if (deviceMatchList.Count > 0 && !deviceMatchList.Contains(device.Key)) { continue; } if (deviceSkipList.Count > 0 && deviceSkipList.Contains(device.Key)) { continue; } for (var deviceNumber = 1; deviceNumber <= device.Value; deviceNumber++) { var deviceInfo = xcaliburAccessor.GetDeviceInfo(device.Key, deviceNumber); datasetFileInfo.DeviceList.Add(deviceInfo); } } }