/// <summary> /// Loads the drivers. /// </summary> public void LoadDrivers() { var selectedItem = installedDrivers_ComboBox.SelectedData; PrintDeviceDriverCollection drivers = new PrintDeviceDriverCollection(); drivers.AddRange(DriverController.LoadFromRegistry().Select(n => new PrintDeviceDriver(n))); drivers.Sort(); installedDrivers_ComboBox.Items.Clear(); installedDrivers_ComboBox.AddDrivers(drivers); if (selectedItem.Count > 0) { ProcessorArchitecture arch = EnumUtil.Parse <ProcessorArchitecture>(selectedItem["Architecture"]); DriverVersion version = new DriverVersion(selectedItem["Version"]); int index = drivers.IndexOf(selectedItem["Name"], arch.ToDriverArchitecture(), version, selectedItem["InfFile"]); if (index != -1) { installedDrivers_ComboBox.SelectedIndex = index; } } else { installedDrivers_ComboBox.SelectedIndex = 0; } }
private void UpdateComboBox() { driverModel_ComboBox.Items.Clear(); driverModel_ComboBox.AddDrivers(_manager.PrintDrivers); if (driverModel_ComboBox.Items.Count > 0) { driverModel_ComboBox.SelectedIndex = 0; } }