summaryrefslogtreecommitdiff
path: root/src/Notepad/Presentation/Model/Menu/File/SaveMenuItem.cs
blob: f99c1796d3ba0f20800ea234298d328412e94d74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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";
        }
    }
}