master
1using Notepad.Presentation.Model.Menu.File.Commands;
2
3namespace Notepad.Presentation.Model.Menu.File {
4 public class ExitMenuItem : IMenuItem {
5 private readonly IExitCommand exitCommand;
6
7 public ExitMenuItem(IExitCommand exitCommand) {
8 this.exitCommand = exitCommand;
9 }
10
11 public string Name() {
12 return "E&xit";
13 }
14
15 public void Click() {
16 exitCommand.Execute();
17 }
18
19 public bool BelongsTo(ISubMenu menu) {
20 return menu.Name().Equals(MenuNames.File);
21 }
22 }
23}