static void Main(string[] args) { Log.Logger = new NLogLogger(); var options = new AutomatedScanningOptions(); try { if (!CommandLine.Parser.Default.ParseArguments(args, options)) { return; } var scanning = KernelManager.Kernel.Get <AutomatedScanning>(new ConstructorArgument("options", options)); scanning.Execute(); } catch (Exception ex) { Log.FatalException("An error occurred that caused the console application to close.", ex); System.Console.WriteLine(ConsoleResources.UnexpectedError); } finally { if (options.WaitForEnter) { System.Console.ReadLine(); } } }
static void Main(string[] args) { Log.Logger = new NLogLogger(); var options = new AutomatedScanningOptions(); try { if (!CommandLine.Parser.Default.ParseArguments(args, options)) { return; } var scanning = KernelManager.Kernel.Get<AutomatedScanning>(new ConstructorArgument("options", options)); scanning.Execute(); } catch (Exception ex) { Log.FatalException("An error occurred that caused the console application to close.", ex); System.Console.WriteLine(ConsoleResources.UnexpectedError); } finally { if (options.WaitForEnter) { System.Console.ReadLine(); } } }
public AutomatedScanning(AutomatedScanningOptions options, IProfileManager profileManager, IScanPerformer scanPerformer, IErrorOutput errorOutput, IEmailer emailer, IScannedImageImporter scannedImageImporter, IUserConfigManager userConfigManager, PdfSettingsContainer pdfSettingsContainer, FileNamePlaceholders fileNamePlaceholders, ImageSettingsContainer imageSettingsContainer, IOperationFactory operationFactory) { 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; }
public AutomatedScanning(AutomatedScanningOptions options, ImageSaver imageSaver, IPdfExporter pdfExporter, IProfileManager profileManager, IScanPerformer scanPerformer, IErrorOutput errorOutput, IEmailer emailer, IScannedImageImporter scannedImageImporter, IUserConfigManager userConfigManager, PdfSettingsContainer pdfSettingsContainer, FileNamePlaceholders fileNamePlaceholders, ImageSettingsContainer imageSettingsContainer, PdfSaver pdfSaver) { this.options = options; this.imageSaver = imageSaver; this.pdfExporter = pdfExporter; 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.pdfSaver = pdfSaver; }
public static void Scan(AutomatedScanningOptions options = null, bool dontThrow = false) { options = options ?? new AutomatedScanningOptions(); try { var scanning = KernelManager.Kernel.Get <AutomatedScanning>(new ConstructorArgument("options", options)); scanning.Execute(); } catch (Exception ex) { Log.FatalException("An error occurred that caused the console application to close.", ex); System.Console.WriteLine(ConsoleResources.UnexpectedError); throw; } finally { if (options.WaitForEnter) { System.Console.ReadLine(); } } }