summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-04-12 15:03:25 +0000
committersr55 <[email protected]>2015-04-12 15:03:25 +0000
commitdaa18af4633c27170a8bd7f880d232ca3c688d9b (patch)
treefb12ff1d1acb7da99ad922e911d2548e5363f3fb /win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
parentca97a5f5239a29e87470509add1fd68099e35f2c (diff)
WinGui: Misc IScan API tweaks.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7087 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs31
1 files changed, 17 insertions, 14 deletions
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
/// <summary>
/// The post scan operation.
/// </summary>
- private Action<bool> postScanOperation;
+ private Action<bool, Source> postScanOperation;
#endregion
@@ -97,6 +97,7 @@ namespace HandBrake.ApplicationServices.Services.Scan
{
this.logging = new StringBuilder();
this.header = GeneralUtilities.CreateLogHeader();
+ this.IsScanning = false;
}
#region Events
@@ -126,11 +127,6 @@ namespace HandBrake.ApplicationServices.Services.Scan
public bool IsScanning { get; private set; }
/// <summary>
- /// Gets the Souce Data.
- /// </summary>
- public Source SouceData { get; private set; }
-
- /// <summary>
/// Gets ActivityLog.
/// </summary>
public string ActivityLog
@@ -165,7 +161,7 @@ namespace HandBrake.ApplicationServices.Services.Scan
/// <param name="configuraiton">
/// The configuraiton.
/// </param>
- public void Scan(string sourcePath, int title, Action<bool> postAction, HBConfiguration configuraiton)
+ public void Scan(string sourcePath, int title, Action<bool, Source> 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
/// <param name="titles">
/// The titles.
/// </param>
- /// <param name="featureTitle">
- /// The feature Title.
- /// </param>
/// <returns>
/// The convert titles.
/// </returns>