private void btnSelect_Click(object sender, EventArgs e) { if (listboxDevices.SelectedItem == null) { listboxDevices.Focus(); return; } DialogResult = DialogResult.OK; SelectedDevice = ((ScanDevice) listboxDevices.SelectedItem); Close(); }
public List<RecoveryIndexImage> TwainScan(int recoveryFileNumber, ScanDevice scanDevice, ScanProfile scanProfile, ScanParams scanParams) { RecoveryImage.RecoveryFileNumber = recoveryFileNumber; return twainWrapper.Scan(ParentForm, true, scanDevice, scanProfile, scanParams).Select(x => x.RecoveryIndexImage).ToList(); }
private void rdWIA_CheckedChanged(object sender, EventArgs e) { if (!suppressChangeEvent) { ScanProfile.Device = null; CurrentDevice = null; UpdateEnabledControls(); } }
private void ChooseDevice(string driverName) { var driver = driverFactory.Create(driverName); try { driver.DialogParent = this; driver.ScanProfile = ScanProfile; ScanDevice device = driver.PromptForDevice(); if (device != null) { if (string.IsNullOrEmpty(txtName.Text) || CurrentDevice != null && CurrentDevice.Name == txtName.Text) { txtName.Text = device.Name; } CurrentDevice = device; } } catch (ScanDriverException e) { if (e is ScanDriverUnknownException) { Log.ErrorException(e.Message, e.InnerException); } errorOutput.DisplayError(e.Message); } }