summaryrefslogtreecommitdiff
path: root/src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs')
-rw-r--r--src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs b/src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs
new file mode 100644
index 0000000..f99c179
--- /dev/null
+++ b/src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs
@@ -0,0 +1,23 @@
+using Notepad.Presentation.Model.Menu.File.Commands;
+
+namespace Notepad.Presentation.Model.Menu.File {
+ public class SaveMenuItem : IMenuItem {
+ private readonly ISaveCommand saveCommand;
+
+ public SaveMenuItem(ISaveCommand saveCommand) {
+ this.saveCommand = saveCommand;
+ }
+
+ public bool BelongsTo(ISubMenu menu) {
+ return menu.Name().Equals(MenuNames.File);
+ }
+
+ public void Click() {
+ saveCommand.Execute();
+ }
+
+ public string Name() {
+ return "&Save";
+ }
+ }
+} \ No newline at end of file