public void TearDown() { imageList = null; }
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; }
public void SetUp() { imageList = new ScannedImageList(); }
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(); } } }