//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ private void ScannerSelectionButton_Click(object sender, EventArgs e) { try { TwainLib.SelectSource(); } catch (Exception ex) { Program.MeldeFehler("Bei diesen Fehler hilft es oft die Konfigurationsdatei(Settings.cfg) zu löschen:\n\n" + Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\n" + ex.Message + "\n" + ex.StackTrace); Environment.Exit(1); } }
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ private void Form1_Shown(object sender, EventArgs e) { try { AllPagesTabControl.TabPages.Clear(); CurPageControl = new PageControl(AllPagesTabControl); ProgramSettings = new Settings(); ProgramSettings.Load(); InsertionCheckBox.Checked = ProgramSettings.UseInsertion; DoubleSidedCheckBox.Checked = ProgramSettings.UseDoubleSided; GreyCheckBox.Checked = ProgramSettings.UseGrey; CheckIfEmptyCheckBox.Checked = ProgramSettings.CheckIfEmpty; EdgeDetectionCheckBox.Checked = ProgramSettings.UseEdgeDetection; RotationCorrectionCheckBox.Checked = ProgramSettings.UseRotationCorrection; VendorToolCheckBox.Checked = ProgramSettings.UseVendorTool; this.Size = new Size(ProgramSettings.SizeX, ProgramSettings.SizeY); Form1_ResizeEnd(null, null); this.Text = "Scanner Tool (v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + ")"; AllButtons = new MaterialRaisedButton[] { ScannerSelectionButton, ResetScanButton, AddScanButton, ScanAndSendFastButton, ScanAndSaveFastButton, SendButton, SaveButton, MovePageForwardButton, MovePageBackButton, RotateImageButton, DeletePageButton }; AllCheckBoxes = new MaterialCheckBox[] { InsertionCheckBox, DoubleSidedCheckBox, GreyCheckBox, EdgeDetectionCheckBox, RotationCorrectionCheckBox, CheckIfEmptyCheckBox, VendorToolCheckBox }; try { olook = new Outlook.Application(); } catch { MessageBox.Show("Ihr Outlook wurde nicht ordnungsgemäß installiert."); Environment.Exit(1075); } ResetTwain(0); if (!string.IsNullOrEmpty(ProgramSettings.ScannerProductName)) { TwainLib.SelectSource(ProgramSettings.ScannerProductName); } GC.Collect(); } catch (Exception ex) { Program.MeldeFehler(ex.Message + "\n" + ex.StackTrace); Environment.Exit(1); } }