From daa18af4633c27170a8bd7f880d232ca3c688d9b Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 12 Apr 2015 15:03:25 +0000 Subject: WinGui: Misc IScan API tweaks. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7087 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Services/Scan/LibScan.cs | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs') diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index 524042606..a560493ab 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -86,7 +86,7 @@ namespace HandBrake.ApplicationServices.Services.Scan /// /// The post scan operation. /// - private Action postScanOperation; + private Action postScanOperation; #endregion @@ -97,6 +97,7 @@ namespace HandBrake.ApplicationServices.Services.Scan { this.logging = new StringBuilder(); this.header = GeneralUtilities.CreateLogHeader(); + this.IsScanning = false; } #region Events @@ -125,11 +126,6 @@ namespace HandBrake.ApplicationServices.Services.Scan /// public bool IsScanning { get; private set; } - /// - /// Gets the Souce Data. - /// - public Source SouceData { get; private set; } - /// /// Gets ActivityLog. /// @@ -165,7 +161,7 @@ namespace HandBrake.ApplicationServices.Services.Scan /// /// The configuraiton. /// - public void Scan(string sourcePath, int title, Action postAction, HBConfiguration configuraiton) + public void Scan(string sourcePath, int title, Action postAction, HBConfiguration configuraiton) { // Try to cleanup any previous scan instances. if (this.instance != null) @@ -326,7 +322,7 @@ namespace HandBrake.ApplicationServices.Services.Scan this.Stop(); if (this.ScanCompleted != null) - this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()")); + this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()", null)); } } @@ -370,20 +366,30 @@ namespace HandBrake.ApplicationServices.Services.Scan } // Process into internal structures. + Source sourceData = null; if (this.instance != null && this.instance.Titles != null) { - this.SouceData = new Source { Titles = ConvertTitles(this.instance.Titles), ScanPath = path }; + sourceData = new Source { Titles = ConvertTitles(this.instance.Titles), ScanPath = path }; } this.IsScanning = false; if (this.postScanOperation != null) { - this.postScanOperation(true); + try + { + this.postScanOperation(true, sourceData); + } + catch (Exception exc) + { + Debug.WriteLine(exc); + } + + this.postScanOperation = null; // Reset } else { - if (this.ScanCompleted != null) this.ScanCompleted(this, new ScanCompletedEventArgs(false, null, string.Empty)); + if (this.ScanCompleted != null) this.ScanCompleted(this, new ScanCompletedEventArgs(false, null, string.Empty, sourceData)); } } @@ -446,9 +452,6 @@ namespace HandBrake.ApplicationServices.Services.Scan /// /// The titles. /// - /// - /// The feature Title. - /// /// /// The convert titles. /// -- cgit v1.2.3