main
1using System.Collections.Generic;
2using gorilla.commons.utility;
3using MoMoney.Presentation.Core;
4using momoney.presentation.presenters;
5using MoMoney.Presentation.Views;
6
7namespace MoMoney.Presentation.Presenters
8{
9 public interface IMainMenuPresenter : IContentPresenter {}
10
11 public class MainMenuPresenter : ContentPresenter<IMainMenuView>, IMainMenuPresenter
12 {
13 IRunPresenterCommand command;
14
15 public MainMenuPresenter(IMainMenuView view, IRunPresenterCommand command) : base(view)
16 {
17 this.command = command;
18 }
19
20 public override void run()
21 {
22 all_factories().each(x => view.add(x));
23 }
24
25 IEnumerable<IActionTaskPaneFactory> all_factories()
26 {
27 yield return new AddCompanyTaskPane(command);
28 yield return new AddIncomeTaskPane(command);
29 yield return new AddBillingTaskPane(command);
30 yield return new AddReportingTaskPane(command);
31 }
32 }
33}