Blockdevice GetDeviceByModel(string serialId) { Blockdevice x = null; lock (storageDevices) { x = storageDevices.GetDeviceByModel(serialId); } return(x); }
Blockdevice UpdateDisk(UsbDevice device) { Blockdevice dev = GetSDevice(device.iSerial); if (dev == null) { dev = GetDeviceByModel(device.idProduct); } return(dev); }
public Blockdevice GetDevice(string serialId) { Blockdevice r = null; foreach (Blockdevice d in Blockdevices.ToArray()) { if (serialId == d.Serial) { r = d; break; } } return(r); }
public Blockdevice GetDeviceByModel(string modelName) { Blockdevice r = null; foreach (Blockdevice d in Blockdevices.ToArray()) { if (modelName == d.Model) { r = d; break; } } return(r); }