Use events for messages from MediaScan.

This commit is contained in:
2019-04-21 00:51:55 +01:00
parent 9052ea80f4
commit 359efb369c
7 changed files with 113 additions and 57 deletions

View File

@@ -111,7 +111,14 @@ namespace DiscImageChef.Commands
Statistics.AddDevice(dev);
MediaScan scanner = new MediaScan(mhddLogPath, ibgLogPath, devicePath, dev);
MediaScan scanner = new MediaScan(mhddLogPath, ibgLogPath, devicePath, dev);
scanner.UpdateStatus += Progress.UpdateStatus;
scanner.ErrorMessage += Progress.ErrorMessage;
scanner.StoppingErrorMessage += Progress.ErrorMessage;
scanner.UpdateProgress += Progress.UpdateProgress;
scanner.PulseProgress += Progress.PulseProgress;
scanner.InitProgress += Progress.InitProgress;
scanner.EndProgress += Progress.EndProgress;
ScanResults results = scanner.Scan();
DicConsole.WriteLine("Took a total of {0} seconds ({1} processing commands).", results.TotalTime,