Exemple #1
0
        public FDesktop(IEmailer emailer, ImageSaver imageSaver, StringWrapper stringWrapper, AppConfigManager appConfigManager, RecoveryManager recoveryManager, IScannedImageImporter scannedImageImporter, AutoUpdaterUI autoUpdaterUI, OcrDependencyManager ocrDependencyManager, IProfileManager profileManager, IScanPerformer scanPerformer, IScannedImagePrinter scannedImagePrinter, ChangeTracker changeTracker, EmailSettingsContainer emailSettingsContainer, FileNamePlaceholders fileNamePlaceholders, ImageSettingsContainer imageSettingsContainer, PdfSettingsContainer pdfSettingsContainer, PdfSaver pdfSaver, IErrorOutput errorOutput)
        {
            this.emailer                = emailer;
            this.imageSaver             = imageSaver;
            this.stringWrapper          = stringWrapper;
            this.appConfigManager       = appConfigManager;
            this.recoveryManager        = recoveryManager;
            this.scannedImageImporter   = scannedImageImporter;
            this.autoUpdaterUI          = autoUpdaterUI;
            this.ocrDependencyManager   = ocrDependencyManager;
            this.profileManager         = profileManager;
            this.scanPerformer          = scanPerformer;
            this.scannedImagePrinter    = scannedImagePrinter;
            this.changeTracker          = changeTracker;
            this.emailSettingsContainer = emailSettingsContainer;
            this.fileNamePlaceholders   = fileNamePlaceholders;
            this.imageSettingsContainer = imageSettingsContainer;
            this.pdfSettingsContainer   = pdfSettingsContainer;
            this.pdfSaver               = pdfSaver;
            this.errorOutput            = errorOutput;
            InitializeComponent();

            thumbnailList1.MouseWheel += thumbnailList1_MouseWheel;
            Shown       += FDesktop_Shown;
            FormClosing += FDesktop_FormClosing;
            Closed      += FDesktop_Closed;
        }
Exemple #2
0
 public AutoSave(IOperationFactory operationFactory, IFormFactory formFactory, PdfSettingsContainer pdfSettingsContainer, OcrDependencyManager ocrDependencyManager, IErrorOutput errorOutput, AppConfigManager appConfigManager, FileNamePlaceholders fileNamePlaceholders, DialogHelper dialogHelper)
 {
     this.operationFactory     = operationFactory;
     this.formFactory          = formFactory;
     this.pdfSettingsContainer = pdfSettingsContainer;
     this.ocrDependencyManager = ocrDependencyManager;
     this.errorOutput          = errorOutput;
     this.appConfigManager     = appConfigManager;
     this.fileNamePlaceholders = fileNamePlaceholders;
     this.dialogHelper         = dialogHelper;
 }
Exemple #3
0
 public BatchState(IScanPerformer scanPerformer, IProfileManager profileManager, FileNamePlaceholders fileNamePlaceholders, IPdfExporter pdfExporter, IOperationFactory operationFactory, PdfSettingsContainer pdfSettingsContainer, OcrDependencyManager ocrDependencyManager, IFormFactory formFactory)
 {
     this.scanPerformer        = scanPerformer;
     this.profileManager       = profileManager;
     this.fileNamePlaceholders = fileNamePlaceholders;
     this.pdfExporter          = pdfExporter;
     this.operationFactory     = operationFactory;
     this.pdfSettingsContainer = pdfSettingsContainer;
     this.ocrDependencyManager = ocrDependencyManager;
     this.formFactory          = formFactory;
 }
 public WinFormsExportHelper(PdfSettingsContainer pdfSettingsContainer, ImageSettingsContainer imageSettingsContainer, EmailSettingsContainer emailSettingsContainer, DialogHelper dialogHelper, FileNamePlaceholders fileNamePlaceholders, ChangeTracker changeTracker, IOperationFactory operationFactory, IFormFactory formFactory, OcrDependencyManager ocrDependencyManager, IEmailer emailer)
 {
     this.pdfSettingsContainer   = pdfSettingsContainer;
     this.imageSettingsContainer = imageSettingsContainer;
     this.emailSettingsContainer = emailSettingsContainer;
     this.dialogHelper           = dialogHelper;
     this.fileNamePlaceholders   = fileNamePlaceholders;
     this.changeTracker          = changeTracker;
     this.operationFactory       = operationFactory;
     this.formFactory            = formFactory;
     this.ocrDependencyManager   = ocrDependencyManager;
     this.emailer = emailer;
 }
Exemple #5
0
 public AutomatedScanning(AutomatedScanningOptions options, IProfileManager profileManager, IScanPerformer scanPerformer, IErrorOutput errorOutput, IEmailer emailer, IScannedImageImporter scannedImageImporter, IUserConfigManager userConfigManager, PdfSettingsContainer pdfSettingsContainer, FileNamePlaceholders fileNamePlaceholders, ImageSettingsContainer imageSettingsContainer, IOperationFactory operationFactory, AppConfigManager appConfigManager, OcrDependencyManager ocrDependencyManager, IFormFactory formFactory)
 {
     this.options                = options;
     this.profileManager         = profileManager;
     this.scanPerformer          = scanPerformer;
     this.errorOutput            = errorOutput;
     this.emailer                = emailer;
     this.scannedImageImporter   = scannedImageImporter;
     this.userConfigManager      = userConfigManager;
     this.pdfSettingsContainer   = pdfSettingsContainer;
     this.fileNamePlaceholders   = fileNamePlaceholders;
     this.imageSettingsContainer = imageSettingsContainer;
     this.operationFactory       = operationFactory;
     this.appConfigManager       = appConfigManager;
     this.ocrDependencyManager   = ocrDependencyManager;
     this.formFactory            = formFactory;
 }
Exemple #6
0
        public FOcrLanguageDownload(OcrDependencyManager ocrDependencyManager)
        {
            this.ocrDependencyManager = ocrDependencyManager;
            InitializeComponent();

            var initialSelection = new HashSet <string>();

            if (!ocrDependencyManager.HasNewTesseractExe)
            {
                // The new OCR version hasn't been installed yet, so pre-select some languages
                if (ocrDependencyManager.Components.Tesseract302.IsInstalled)
                {
                    // Upgrading from an old version, so pre-select previously used languages
                    foreach (var lang in ocrDependencyManager.Components.Tesseract302Languages.Where(x => x.Value.IsInstalled))
                    {
                        initialSelection.Add(lang.Key);
                    }
                }
                else
                {
                    // Fresh install, so pre-select English as a sensible default
                    initialSelection.Add("eng");
                }
            }

            // Populate the list of language options
            // Special case for English: sorted to the top of the list
            var languageOptions = ocrDependencyManager.Components.Tesseract304Languages.Where(x => !x.Value.IsInstalled)
                                  .Select(x => ocrDependencyManager.Languages[x.Key])
                                  .OrderBy(x => x.Code == "eng" ? "AAA" : x.Name);

            foreach (var languageOption in languageOptions)
            {
                var item = new ListViewItem {
                    Text = languageOption.Name, Tag = languageOption.Code
                };
                if (initialSelection.Contains(languageOption.Code))
                {
                    item.Checked = true;
                }
                lvLanguages.Items.Add(item);
            }

            UpdateView();
        }
Exemple #7
0
        public FOcrLanguageDownload(OcrDependencyManager ocrDependencyManager)
        {
            this.ocrDependencyManager = ocrDependencyManager;
            InitializeComponent();

            var initialSelection = new HashSet <string>();

            if (ocrDependencyManager.IsExecutableDownloaded && !ocrDependencyManager.IsNewExecutableDownloaded)
            {
                // Upgrade
                foreach (var lang in ocrDependencyManager.GetDownloadedLanguages())
                {
                    initialSelection.Add(lang.Code);
                }
            }
            else if (!ocrDependencyManager.IsExecutableDownloaded)
            {
                // Fresh install
                initialSelection.Add("eng");
            }

            // Add missing languages to the list of language options
            // Special case for English: sorted first, and checked by default
            var languageOptions = this.ocrDependencyManager.GetMissingLanguages().OrderBy(x => x.Code == "eng" ? "AAA" : x.LangName);

            foreach (var languageOption in languageOptions)
            {
                var item = new ListViewItem {
                    Text = languageOption.LangName, Tag = languageOption
                };
                if (initialSelection.Contains(languageOption.Code))
                {
                    item.Checked = true;
                }
                lvLanguages.Items.Add(item);
            }

            UpdateView();
        }
Exemple #8
0
        public FOcrLanguageDownload(OcrDependencyManager ocrDependencyManager)
        {
            this.ocrDependencyManager = ocrDependencyManager;
            InitializeComponent();

            // Add missing languages to the list of language options
            // Special case for English: sorted first, and checked by default
            var languageOptions = this.ocrDependencyManager.GetMissingLanguages().OrderBy(x => x.Code == "eng" ? "AAA" : x.LangName);

            foreach (var languageOption in languageOptions)
            {
                var item = new ListViewItem {
                    Text = languageOption.LangName, Tag = languageOption
                };
                if (languageOption.Code == "eng")
                {
                    item.Checked = true;
                }
                lvLanguages.Items.Add(item);
            }

            UpdateView();
        }
Exemple #9
0
 public FOcrSetup(OcrDependencyManager ocrDependencyManager)
 {
     this.ocrDependencyManager = ocrDependencyManager;
     InitializeComponent();
 }
Exemple #10
0
 public FOcrSetup(OcrDependencyManager ocrDependencyManager, AppConfigManager appConfigManager)
 {
     this.ocrDependencyManager = ocrDependencyManager;
     this.appConfigManager     = appConfigManager;
     InitializeComponent();
 }