Пример #1
0
 public void TearDown()
 {
     imageList = null;
 }
Пример #2
0
        public void Execute()
        {
            if (!ValidateOptions())
            {
                return;
            }

            startTime = DateTime.Now;
            ConsoleOverwritePrompt.ForceOverwrite = options.ForceOverwrite;

            if (!PreCheckOverwriteFile())
            {
                return;
            }

            imageList = new ScannedImageList { UserConfigManager = userConfigManager };

            if (options.ImportPath != null)
            {
                ImportImages();
            }

            if (options.Number > 0)
            {
                ScanProfile profile;
                if (!GetProfile(out profile))
                {
                    return;
                }

                PerformScan(profile);
            }

            ReorderScannedImages();

            if (options.OutputPath != null)
            {
                ExportScannedImages();
            }

            if (options.EmailFileName != null)
            {
                EmailScannedImages();
            }

            foreach (var image in imageList.Images)
            {
                image.Dispose();
            }

            imageList = null;
        }
Пример #3
0
 public void SetUp()
 {
     imageList = new ScannedImageList();
 }
Пример #4
0
        public void Execute()
        {
            try
            {
                if (!ValidateOptions())
                {
                    return;
                }

                startTime = DateTime.Now;
                ConsoleOverwritePrompt.ForceOverwrite = options.ForceOverwrite;

                if (!PreCheckOverwriteFile())
                {
                    return;
                }

                imageList = new ScannedImageList();

                if (options.ImportPath != null)
                {
                    ImportImages();
                }

                if (options.Number > 0)
                {
                    ScanProfile profile;
                    if (!GetProfile(out profile))
                    {
                        return;
                    }

                    PerformScan(profile);
                }

                ReorderScannedImages();

                if (options.OutputPath != null)
                {
                    ExportScannedImages();
                }

                if (options.EmailFileName != null)
                {
                    EmailScannedImages();
                }

                foreach (var image in imageList.Images)
                {
                    image.Dispose();
                }

                imageList = null;
            }
            catch (Exception ex)
            {
                Log.FatalException("An error occurred that caused the console application to close.", ex);
                Console.WriteLine(ConsoleResources.UnexpectedError);
            }
            finally
            {
                if (options.WaitForEnter)
                {
                    Console.ReadLine();
                }
            }
        }