public static string UISelectDeviceID(TextModeDriverDirectory driverDirectory) { var driverINI = driverDirectory.TextModeDriverSetupINI; string deviceID; if (driverINI.Devices.Count > 1) { Console.WriteLine("The directory specified contains drivers for the following devices:"); for (var index = 0; index < driverINI.Devices.Count; index++) { Console.WriteLine("{0}. {1}", index + 1, driverINI.Devices[index].Value); } Console.Write("Select the device driver you wish to integrate: "); // driver number could be double-digit, so we use ReadLine() var selection = Conversion.ToInt32(Console.ReadLine()) - 1; if (selection >= 0 && selection < driverINI.Devices.Count) { deviceID = driverINI.Devices[selection].Key; return(deviceID); } Console.WriteLine("Error: No driver has been selected, exiting."); return(string.Empty); } if (driverINI.Devices.Count == 1) { deviceID = driverINI.Devices[0].Key; var deviceName = driverINI.Devices[0].Value; Console.WriteLine("Found one driver:"); Console.WriteLine("1. " + deviceName); return(deviceID); } Console.WriteLine("Mass storage device driver has not been found."); return(string.Empty); }
public TextModeDriverIntegrator(TextModeDriverDirectory driverDirectory, WindowsInstallation installation, string deviceID) { _driverDirectory = driverDirectory; _installation = installation; _deviceID = deviceID; }