summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Commands
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-05-17 21:01:30 +0000
committersr55 <[email protected]>2015-05-17 21:01:30 +0000
commit525d9fae34a7981eb5f6de46135d909551480043 (patch)
treea38306689787207fbd346fe32e69f261b455f6ec /win/CS/HandBrakeWPF/Commands
parentf44ed828e6e1fa5f64d48be8f19bb5525434f263 (diff)
WinGui: General tidy up and remove the custom styling for the app. The app will now always honour the system defaults.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7207 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Commands')
-rw-r--r--win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs118
1 files changed, 0 insertions, 118 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
deleted file mode 100644
index 4bf88f35a..000000000
--- a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="CancelScanCommand.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>
-// Command to cancel a scan that is in progress
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Commands
-{
- using System;
- using System.Windows.Input;
-
- using HandBrake.ApplicationServices.Services.Scan.EventArgs;
- using HandBrake.ApplicationServices.Services.Scan.Interfaces;
-
- /// <summary>
- /// Command to cancel a scan that is in progress
- /// </summary>
- public class CancelScanCommand : ICommand
- {
- /// <summary>
- /// The scan service wrapper.
- /// </summary>
- private readonly IScan scanServiceWrapper;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="CancelScanCommand"/> class.
- /// </summary>
- /// <param name="ssw">
- /// The scan service wrapper.
- /// </param>
- public CancelScanCommand(IScan ssw)
- {
- this.scanServiceWrapper = ssw;
- this.scanServiceWrapper.ScanStarted += this.ScanServiceWrapperScanStared;
- this.scanServiceWrapper.ScanCompleted += this.ScanServiceWrapperScanCompleted;
- }
-
- /// <summary>
- /// The scan service Scan Completed Event Handler.
- /// Fires CanExecuteChanged
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The ScanCompletedEventArgs.
- /// </param>
- private void ScanServiceWrapperScanCompleted(object sender, ScanCompletedEventArgs e)
- {
- Caliburn.Micro.Execute.OnUIThread(this.OnCanExecuteChanged);
- }
-
- /// <summary>
- /// The scan service scan started event handler.
- /// Fires CanExecuteChanged
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EventArgs.
- /// </param>
- private void ScanServiceWrapperScanStared(object sender, EventArgs e)
- {
- Caliburn.Micro.Execute.OnUIThread(this.OnCanExecuteChanged);
- }
-
- #region Implementation of ICommand
-
- /// <summary>
- /// Defines the method to be called when the command is invoked.
- /// </summary>
- /// <param name="parameter">Data used by the command. If the command does not require data to be passed, this object can be set to null.</param>
- public void Execute(object parameter)
- {
- this.scanServiceWrapper.Stop();
- }
-
- /// <summary>
- /// Defines the method that determines whether the command can execute in its current state.
- /// </summary>
- /// <returns>
- /// true if this command can be executed; otherwise, false.
- /// </returns>
- /// <param name="parameter">Data used by the command. If the command does not require data to be passed, this object can be set to null.</param>
- public bool CanExecute(object parameter)
- {
- if (this.scanServiceWrapper != null)
- {
- return this.scanServiceWrapper.IsScanning;
- }
-
- return false;
- }
-
- /// <summary>
- /// The can execute changed.
- /// </summary>
- public event EventHandler CanExecuteChanged;
-
- /// <summary>
- /// The on can execute changed.
- /// </summary>
- protected virtual void OnCanExecuteChanged()
- {
- EventHandler handler = this.CanExecuteChanged;
- if (handler != null)
- {
- handler(this, EventArgs.Empty);
- }
- }
-
- #endregion
- }
-}