summaryrefslogtreecommitdiff
path: root/product/Presentation/Presenters/AddReportingTaskPane.cs
blob: d89f31d276eb7e139f35fcea3fe99aa1f03d0c96 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Collections.Generic;
using MoMoney.DTO;
using MoMoney.Presentation.Views;
using MoMoney.Presentation.Winforms.Resources;
using MoMoney.Service.Contracts.Application;
using XPExplorerBar;

namespace MoMoney.Presentation.Presenters
{
    public class AddReportingTaskPane : IActionTaskPaneFactory
    {
        readonly IRunPresenterCommand command;

        public AddReportingTaskPane(IRunPresenterCommand command)
        {
            this.command = command;
        }

        public Expando create()
        {
            return Build.task_pane()
                .named("Reports")
                .with_item(
                Build.task_pane_item()
                    .named("View All Bills")
                    .represented_by_icon(ApplicationIcons.ViewAllBillPayments)
                    .when_clicked_execute(() => command.run<IReportPresenter<IViewAllBillsReport, IEnumerable<BillInformationDTO>, IGetAllBillsQuery>>())
                )
                .with_item(
                Build.task_pane_item()
                    .named("View All Income")
                    .represented_by_icon(ApplicationIcons.ViewAllIncome)
                    .when_clicked_execute(() => command.run<IReportPresenter<IViewAllIncomeReport, IEnumerable<IncomeInformationDTO>, IGetAllIncomeQuery>>())
                )
                .build();
        }
    }
}