diff options
author | sr55 <[email protected]> | 2013-09-21 16:25:39 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-09-21 16:25:39 +0000 |
commit | bb3aae9dd06271ab7b18a2d55fec14c97b76e9b0 (patch) | |
tree | b18340eaf83379f35ec9bc1f6d611364cfa316b2 /win/CS/HandBrakeWPF | |
parent | 173b4f70468b2a762c180596fa1b313fd319a463 (diff) |
WinGui: Remove the scan service wrapper as it's no longer needed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5789 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs | 7 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs | 195 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 4 |
8 files changed, 12 insertions, 212 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs index e9ec9966a..b00061068 100644 --- a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs +++ b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs @@ -22,7 +22,7 @@ namespace HandBrakeWPF.Commands /// <summary>
/// The scan service wrapper.
/// </summary>
- private readonly IScanServiceWrapper scanServiceWrapper;
+ private readonly IScan scanServiceWrapper;
/// <summary>
/// Initializes a new instance of the <see cref="CancelScanCommand"/> class.
@@ -30,7 +30,7 @@ namespace HandBrakeWPF.Commands /// <param name="ssw">
/// The scan service wrapper.
/// </param>
- public CancelScanCommand(IScanServiceWrapper ssw)
+ public CancelScanCommand(IScan ssw)
{
this.scanServiceWrapper = ssw;
this.scanServiceWrapper.ScanStared += this.ScanServiceWrapperScanStared;
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index b0094ce23..66eb70257 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -179,7 +179,6 @@ <Compile Include="Services\Interfaces\IUpdateService.cs" />
<Compile Include="Services\Interfaces\IPrePostActionService.cs" />
<Compile Include="Services\NotificationService.cs" />
- <Compile Include="Services\ScanServiceWrapper.cs" />
<Compile Include="Services\UpdateService.cs" />
<Compile Include="Services\PrePostActionService.cs" />
<Compile Include="ViewModels\AdvancedViewModel.cs" />
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs index 2dd1814ee..7fc3c76ff 100644 --- a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs +++ b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs @@ -64,12 +64,7 @@ namespace HandBrakeWPF.Services }
else
{
- if (ScanServiceWrapper.HandbrakeInstance == null)
- {
- ScanServiceWrapper.HandbrakeInstance = new HandBrakeInstance();
- }
-
- this.encodeService = new LibEncode(userSettingService, ScanServiceWrapper.HandbrakeInstance);
+ this.encodeService = new LibEncode(userSettingService, new HandBrakeInstance());
}
}
catch (Exception exc)
diff --git a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs deleted file mode 100644 index 8180ac070..000000000 --- a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs +++ /dev/null @@ -1,195 +0,0 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="ScanServiceWrapper.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// We have multiple implementations of IScan. This is a wrapper class for the GUI so that the
-// implementation used is controllable via user settings.
-// Over time, this class will go away when the LibHB and process isolation code matures.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Services
-{
- using System;
-
- using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Services;
- using HandBrake.ApplicationServices.Services.Interfaces;
- using HandBrake.Interop.Interfaces;
-
- /// <summary>
- /// We have multiple implementations of IScan. This is a wrapper class for the GUI so that the
- /// implementation used is controllable via user settings.
- /// Over time, this class will go away when the LibHB and process isolation code matures.
- /// </summary>
- public class ScanServiceWrapper : IScanServiceWrapper
- {
- #region Constants and Fields
-
- /// <summary>
- /// The handbrake instance.
- /// </summary>
- public static IHandBrakeInstance HandbrakeInstance;
-
- /// <summary>
- /// The scan service.
- /// </summary>
- private readonly IScan scanService;
-
- #endregion
-
- #region Constructors and Destructors
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ScanServiceWrapper"/> class.
- /// </summary>
- /// <param name="userSettingService">
- /// The user Setting Service.
- /// </param>
- public ScanServiceWrapper(IUserSettingService userSettingService)
- {
- this.scanService = new LibScan(userSettingService);
- this.scanService.ScanCompleted += this.ScanServiceScanCompleted;
- this.scanService.ScanStared += this.ScanServiceScanStared;
- this.scanService.ScanStatusChanged += this.ScanServiceScanStatusChanged;
- }
-
- /// <summary>
- /// The scan service scan status changed event
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The ScanProgressEventArgs.
- /// </param>
- private void ScanServiceScanStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.ScanProgressEventArgs e)
- {
- this.ScanStatusChanged(sender, e);
- }
-
- /// <summary>
- /// The scan service scan stared event
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EventArgs
- /// </param>
- private void ScanServiceScanStared(object sender, EventArgs e)
- {
- this.ScanStared(sender, e);
- }
-
- /// <summary>
- /// The scan service scan completed event
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The ScanCompletedEventArgs
- /// </param>
- private void ScanServiceScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e)
- {
- this.ScanCompleted(sender, e);
- }
-
- #endregion
-
- #region Events
-
- /// <summary>
- /// The scan completed.
- /// </summary>
- public event ScanCompletedStatus ScanCompleted;
-
- /// <summary>
- /// The scan stared.
- /// </summary>
- public event EventHandler ScanStared;
-
- /// <summary>
- /// The scan status changed.
- /// </summary>
- public event ScanProgessStatus ScanStatusChanged;
-
- #endregion
-
- #region Properties
-
- /// <summary>
- /// Gets ActivityLog.
- /// </summary>
- public string ActivityLog
- {
- get
- {
- return this.scanService.ActivityLog;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether IsScanning.
- /// </summary>
- public bool IsScanning
- {
- get
- {
- return this.scanService.IsScanning;
- }
- }
-
- /// <summary>
- /// Gets the Souce Data.
- /// </summary>
- public Source SouceData
- {
- get
- {
- return this.scanService.SouceData;
- }
- }
-
- #endregion
-
- #region Implemented Interfaces
-
- #region IScan
-
- /// <summary>
- /// Scan a Source Path.
- /// Title 0: scan all
- /// </summary>
- /// <param name="sourcePath">
- /// Path to the file to scan
- /// </param>
- /// <param name="title">
- /// int title number. 0 for scan all
- /// </param>
- /// <param name="previewCount">
- /// The preview Count.
- /// </param>
- /// <param name="postAction">
- /// The post Action.
- /// </param>
- public void Scan(string sourcePath, int title, int previewCount, Action<bool> postAction)
- {
- this.scanService.Scan(sourcePath, title, previewCount, postAction);
- }
-
- /// <summary>
- /// Kill the scan
- /// </summary>
- public void Stop()
- {
- this.scanService.Stop();
- }
-
- #endregion
-
- #endregion
- }
-}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs index 0debbbcce..34f58c862 100644 --- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs @@ -21,6 +21,7 @@ namespace HandBrakeWPF.Startup using Castle.Windsor;
using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.Commands;
@@ -57,7 +58,7 @@ namespace HandBrakeWPF.Startup // Services
this.windsorContainer.Register(Component.For<IUpdateService>().ImplementedBy<UpdateService>().LifeStyle.Is(LifestyleType.Singleton));
- this.windsorContainer.Register(Component.For<IScanServiceWrapper>().ImplementedBy<ScanServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IScan>().ImplementedBy<LibScan>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IEncodeServiceWrapper>().ImplementedBy<EncodeServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<INotificationService>().ImplementedBy<NotificationService>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IPrePostActionService>().ImplementedBy<PrePostActionService>().LifeStyle.Is(LifestyleType.Singleton));
diff --git a/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs index 8edfb3a87..c99fb1c51 100644 --- a/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs @@ -69,7 +69,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// The scan service.
/// </summary>
- private readonly IScanServiceWrapper scanService;
+ private readonly IScan scanService;
/// <summary>
/// The shell view model.
@@ -181,8 +181,8 @@ namespace HandBrakeWPF.ViewModels /// The when done service.
/// </param>
public InstantViewModel(
- IUserSettingService userSettingService,
- IScanServiceWrapper scanService,
+ IUserSettingService userSettingService,
+ IScan scanService,
IEncodeServiceWrapper encodeService,
IPresetService presetService,
IErrorService errorService,
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs index ad5698b1b..8356b124b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs @@ -33,7 +33,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Backing field for the Scan Service
/// </summary>
- private readonly IScanServiceWrapper scanService;
+ private readonly IScan scanService;
/// <summary>
/// The selected tab.
@@ -56,7 +56,7 @@ namespace HandBrakeWPF.ViewModels /// <param name="scanService">
/// The scan service.
/// </param>
- public LogViewModel(IEncodeServiceWrapper encodeService, IScanServiceWrapper scanService)
+ public LogViewModel(IEncodeServiceWrapper encodeService, IScan scanService)
{
this.encodeService = encodeService;
this.scanService = scanService;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index b3be2b60e..de6d7c063 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -84,7 +84,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// The Source Scan Service.
/// </summary>
- private readonly IScanServiceWrapper scanService;
+ private readonly IScan scanService;
/// <summary>
/// The Encode Service
@@ -211,7 +211,7 @@ namespace HandBrakeWPF.ViewModels /// The when Done Service.
/// *** Leave in Constructor. ***
/// </param>
- public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
+ public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, INotificationService notificationService,
IPrePostActionService whenDoneService)
{
|