diff options
| author | mo <mo.khan@gmail.com> | 2018-11-04 15:22:16 -0700 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2018-11-04 15:22:16 -0700 |
| commit | 5ee1f55497a4e30322a56f133f897ecde1612967 (patch) | |
| tree | bf544e0879234c3623869627d8786776cb19b8e9 /src/Notepad/Presentation/Model/Menu/File/FileMenu.cs | |
Diffstat (limited to 'src/Notepad/Presentation/Model/Menu/File/FileMenu.cs')
| -rw-r--r-- | src/Notepad/Presentation/Model/Menu/File/FileMenu.cs | 26 |
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 |
