Example #1
0
 private void btnSelect_Click(object sender, EventArgs e)
 {
     if (listboxDevices.SelectedItem == null)
     {
         listboxDevices.Focus();
         return;
     }
     DialogResult = DialogResult.OK;
     SelectedDevice = ((ScanDevice) listboxDevices.SelectedItem);
     Close();
 }
Example #2
0
 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();
 }
Example #3
0
 private void rdWIA_CheckedChanged(object sender, EventArgs e)
 {
     if (!suppressChangeEvent)
     {
         ScanProfile.Device = null;
         CurrentDevice = null;
         UpdateEnabledControls();
     }
 }
Example #4
0
 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);
     }
 }