main
 1using MoMoney.Presentation;
 2using momoney.presentation.model.eventing;
 3using momoney.presentation.presenters;
 4using MoMoney.Presentation.Presenters;
 5using MoMoney.Service.Infrastructure.Eventing;
 6
 7namespace MoMoney.Modules
 8{
 9    public interface IGettingStartedModule : IModule,
10                                             IEventSubscriber<NewProjectOpened>,
11                                             IEventSubscriber<ClosingProjectEvent>
12    {
13    }
14
15    public class GettingStartedModule : IGettingStartedModule
16    {
17        readonly IEventAggregator broker;
18        readonly IRunPresenterCommand command;
19
20        public GettingStartedModule(IEventAggregator broker, IRunPresenterCommand command)
21        {
22            this.broker = broker;
23            this.command = command;
24        }
25
26        public void run()
27        {
28            broker.subscribe(this);
29            command.run<IGettingStartedPresenter>();
30        }
31
32        public void notify(NewProjectOpened message)
33        {
34            command.run<IGettingStartedPresenter>();
35        }
36
37        public void notify(ClosingProjectEvent message)
38        {
39            command.run<IGettingStartedPresenter>();
40        }
41    }
42}