Beispiel #1
0
        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();
                }
            }
        }
Beispiel #2
0
 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();
         }
     }
 }
Beispiel #3
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)
 {
     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;
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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();
         }
     }
 }