summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs30
1 files changed, 17 insertions, 13 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 3fc83ddac..5f65b26ce 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -48,16 +48,6 @@ namespace HandBrakeWPF.ViewModels
#region Private Variables and Services
/// <summary>
- /// The Source Scan Service.
- /// </summary>
- private IScan scanService;
-
- /// <summary>
- /// The Encode Service
- /// </summary>
- private readonly IEncode encodeService;
-
- /// <summary>
/// The Encode Service
/// </summary>
private readonly IQueueProcessor queueProcessor;
@@ -93,6 +83,16 @@ namespace HandBrakeWPF.ViewModels
private readonly IUserSettingService userSettingService;
/// <summary>
+ /// The Source Scan Service.
+ /// </summary>
+ private IScan scanService;
+
+ /// <summary>
+ /// The Encode Service
+ /// </summary>
+ private IEncode encodeService;
+
+ /// <summary>
/// HandBrakes Main Window Title
/// </summary>
private string windowName;
@@ -1147,18 +1147,22 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void TestIsolationServices()
{
- // Unhook the old service
+ // Unhook the old services
this.scanService.ScanStared -= this.ScanStared;
this.scanService.ScanCompleted -= this.ScanCompleted;
this.scanService.ScanStatusChanged -= this.ScanStatusChanged;
+ this.queueProcessor.EncodeService.EncodeStatusChanged -= this.EncodeStatusChanged;
- // Replace the Service
+ // Replace the Services
this.scanService = new IsolatedScanService(this.errorService);
+ this.encodeService = new IsolatedEncodeService(this.errorService);
+ this.queueProcessor.SwapEncodeService(this.encodeService);
- // Add Event Hooks
+ // Add the new Event Hooks
this.scanService.ScanStared += this.ScanStared;
this.scanService.ScanCompleted += this.ScanCompleted;
this.scanService.ScanStatusChanged += this.ScanStatusChanged;
+ this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
}
#endregion