summaryrefslogtreecommitdiff
path: root/product/Presentation/Presenters/RunThe.cs
blob: 1ce2f115081d3fe4e6d5f420a33902855000862b (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
using gorilla.commons.utility;
using MoMoney.Presentation.Core;
using MoMoney.Service.Infrastructure.Threading;

namespace momoney.presentation.presenters
{
    public interface IRunThe<TPresenter> : Command where TPresenter : IPresenter {}

    public class RunThe<TPresenter> : IRunThe<TPresenter> where TPresenter : IPresenter
    {
        readonly IApplicationController controller;
        readonly CommandProcessor processor;

        public RunThe(IApplicationController controller, CommandProcessor processor)
        {
            this.controller = controller;
            this.processor = processor;
        }

        public void run()
        {
            processor.add(() => controller.run<TPresenter>());
        }
    }
}