summaryrefslogtreecommitdiff
path: root/src/Notepad/Presentation/Model/Menu/Help/AboutMenuItem.cs
blob: 82a2839c6aa52405c25c721a3820d5bf9bcef2f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using Notepad.Presentation.Presenters.Commands;
using Notepad.Presentation.Presenters.Menu.Help;

namespace Notepad.Presentation.Model.Menu.Help {
    public class AboutMenuItem : IMenuItem {
        private readonly IRunPresenterCommand<IAboutApplicationPresenter> displayAboutCommand;

        public AboutMenuItem(IRunPresenterCommand<IAboutApplicationPresenter> displayAboutCommand) {
            this.displayAboutCommand = displayAboutCommand;
        }

        public bool BelongsTo(ISubMenu menu) {
            return menu.Name().Equals(MenuNames.Help);
        }

        public void Click() {
            displayAboutCommand.Execute();
        }

        public string Name() {
            return MenuItemNames.About;
        }
    }
}