Refactor: Use delegates to report progress and status.

This commit is contained in:
2017-05-28 00:31:46 +01:00
parent 33d8945f1d
commit 8d3e4fe420
10 changed files with 345 additions and 45 deletions

View File

@@ -41,6 +41,9 @@ namespace DiscImageChef.Commands
public static void doBenchmark(BenchmarkOptions options)
{
Dictionary<string, double> checksumTimes = new Dictionary<string, double>();
Core.Benchmark.InitProgressEvent += Progress.InitProgress;
Core.Benchmark.UpdateProgressEvent += Progress.UpdateProgress;
Core.Benchmark.EndProgressEvent += Progress.EndProgress;
BenchmarkResults results = Core.Benchmark.Do(options.BufferSize * 1024 * 1024, options.BlockSize);

View File

@@ -93,6 +93,14 @@ namespace DiscImageChef.Commands
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
Core.Statistics.AddFilter(inputFilter.Name);
Sidecar.InitProgressEvent += Progress.InitProgress;
Sidecar.UpdateProgressEvent += Progress.UpdateProgress;
Sidecar.EndProgressEvent += Progress.EndProgress;
Sidecar.InitProgressEvent2 += Progress.InitProgress2;
Sidecar.UpdateProgressEvent2 += Progress.UpdateProgress2;
Sidecar.EndProgressEvent2 += Progress.EndProgress2;
Sidecar.UpdateStatusEvent += Progress.UpdateStatus;
CICMMetadataType sidecar = Sidecar.Create(_imageFormat, options.InputFile);
DicConsole.WriteLine("Writing metadata sidecar");