summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-07-13 21:28:03 +0000
committersr55 <[email protected]>2012-07-13 21:28:03 +0000
commit2425840702b5e319165384f73a51874349ee6d84 (patch)
tree2e4868e7839f841a8127e2275577b7f797e15677 /win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs
parent252b183a32348050bbf9c23f3d70e9723db9271a (diff)
WinGui: Improve the code behind the taskbar source menu. Note, The Disc insert detection still isn't in place, so it will only show the initial available drives, it won't detect disc changes yet.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4828 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs')
-rw-r--r--win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs86
1 files changed, 86 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs b/win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs
new file mode 100644
index 000000000..661ef7fe3
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Commands/SourceMenuCommand.cs
@@ -0,0 +1,86 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceMenuCommand.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>
+// Defines the SourceMenuCommand type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Commands
+{
+ using System;
+ using System.Windows.Input;
+
+ /// <summary>
+ /// The source menu command.
+ /// </summary>
+ public class SourceMenuCommand : ICommand
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The execute action.
+ /// </summary>
+ private readonly Action executeAction;
+
+ #endregion
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SourceMenuCommand"/> class.
+ /// </summary>
+ /// <param name="executeAction">
+ /// The execute action.
+ /// </param>
+ public SourceMenuCommand(Action executeAction)
+ {
+ this.executeAction = executeAction;
+ }
+
+ #endregion
+
+ #region Events
+
+ /// <summary>
+ /// The can execute changed.
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+
+ #endregion
+
+ #region Implemented Interfaces
+
+ #region ICommand
+
+ /// <summary>
+ /// The can execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <returns>
+ /// The System.Boolean.
+ /// </returns>
+ public bool CanExecute(object parameter)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// The execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ public void Execute(object parameter)
+ {
+ this.executeAction();
+ }
+
+ #endregion
+
+ #endregion
+ }
+} \ No newline at end of file