Allow MediaScan to be aborted.

This commit is contained in:
2019-04-21 00:59:01 +01:00
parent 359efb369c
commit 66108773d2
6 changed files with 16 additions and 14 deletions

View File

@@ -119,6 +119,11 @@ namespace DiscImageChef.Commands
scanner.PulseProgress += Progress.PulseProgress;
scanner.InitProgress += Progress.InitProgress;
scanner.EndProgress += Progress.EndProgress;
System.Console.CancelKeyPress += (sender, e) =>
{
e.Cancel = true;
scanner.Abort();
};
ScanResults results = scanner.Scan();
DicConsole.WriteLine("Took a total of {0} seconds ({1} processing commands).", results.TotalTime,