using HandBrake.ApplicationServices.Services.Logging.Interfaces;
using HandBrake.ApplicationServices.Services.Logging.Model;
- using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Encode.Model;
using HandBrakeWPF.Services.Encode.Model.Models;
using HandBrakeWPF.Services.Scan.EventArgs;
}
}
+ this.isCancelled = false;
+
// Handle the post scan operation.
this.postScanOperation = postAction;
{
try
{
- this.ServiceLogMessage("Stopping Scan.");
+ this.ServiceLogMessage("Stopping Scan ...");
this.IsScanning = false;
this.instance.StopScan();
+ this.ServiceLogMessage("Scan Stopped ...");
}
catch (Exception exc)
{
- this.isCancelled = false;
- this.ScanCompleted?.Invoke(this, new ScanCompletedEventArgs(false, exc, Resources.ScanService_ScanStopFailed, null));
- // Do Nothing.
+ this.ServiceLogMessage(exc.ToString());
+ }
+ finally
+ {
+ this.ScanCompleted?.Invoke(this, new ScanCompletedEventArgs(this.isCancelled, null, null, null));
}
}
}
catch (AccessViolationException e)
{
- Console.WriteLine(e);
+ Debug.WriteLine(e);
}
return bitmapImage;
{
this.ServiceLogMessage("Scan Failed ..." + Environment.NewLine + exc);
this.Stop();
-
- this.ScanCompleted?.Invoke(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()", null));
}
}
/// </param>
private void InstanceScanCompleted(object sender, System.EventArgs e)
{
- this.ServiceLogMessage("Scan Finished ...");
+ this.ServiceLogMessage("Processing Scan Information ...");
bool cancelled = this.isCancelled;
this.isCancelled = false;
}
this.postScanOperation = null; // Reset
+ this.ServiceLogMessage("Scan Finished for Queue Edit ...");
}
else
{
this.ScanCompleted?.Invoke(this, new ScanCompletedEventArgs(cancelled, null, string.Empty, sourceData));
+ this.ServiceLogMessage("Scan Finished ...");
}
}
/// </summary>\r
public void CancelScan()\r
{\r
+ this.ShowStatusWindow = false;\r
this.scanService.Cancel();\r
}\r
\r
\r
Execute.OnUIThread(() =>\r
{\r
+ this.ShowStatusWindow = false;\r
+\r
if (e.Successful)\r
{\r
this.NotifyOfPropertyChange(() => this.ScannedSource);\r
this.OpenAlertWindow(Resources.Main_ScanNoTitlesFound, Resources.Main_ScanNoTitlesFoundMessage);\r
}\r
\r
- this.ShowStatusWindow = false;\r
if (e.Successful)\r
{\r
this.SourceLabel = this.SourceName;\r