summaryrefslogtreecommitdiff
path: root/src/Notepad/Presentation/Model/Menu/File/FileMenu.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Notepad/Presentation/Model/Menu/File/FileMenu.cs')
-rw-r--r--src/Notepad/Presentation/Model/Menu/File/FileMenu.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Notepad/Presentation/Model/Menu/File/FileMenu.cs b/src/Notepad/Presentation/Model/Menu/File/FileMenu.cs
new file mode 100644
index 0000000..98b5a47
--- /dev/null
+++ b/src/Notepad/Presentation/Model/Menu/File/FileMenu.cs
@@ -0,0 +1,26 @@
+using System.Collections.Generic;
+using Notepad.Domain.Repositories;
+using Notepad.Infrastructure.Extensions;
+
+namespace Notepad.Presentation.Model.Menu.File {
+ public class FileMenu : ISubMenu {
+ private readonly IRepository<IMenuItem> repository;
+ private readonly IMenuItemComparer menuItemComparer;
+
+ public FileMenu(IRepository<IMenuItem> repository, IMenuItemComparer menuItemComparer) {
+ this.repository = repository;
+ this.menuItemComparer = menuItemComparer;
+ }
+
+ public IEnumerable<IMenuItem> AllMenuItems() {
+ return repository
+ .All()
+ .ThatSatisfy(menuItem => menuItem.BelongsTo(this))
+ .SortedUsing(menuItemComparer);
+ }
+
+ public string Name() {
+ return MenuNames.File;
+ }
+ }
+} \ No newline at end of file