main
1using gorilla.commons.Utility;
2using momoney.presentation.presenters;
3using momoney.presentation.views;
4using MoMoney.Presentation.Winforms.Views;
5using momoney.service.infrastructure.threading;
6using MoMoney.Service.Infrastructure.Threading;
7
8namespace MoMoney.Presentation.Presenters
9{
10 public interface ISplashScreenPresenter : DisposableCommand, ITimerClient {}
11
12 public class SplashScreenPresenter : ISplashScreenPresenter
13 {
14 readonly ITimer timer;
15 readonly ISplashScreenView view;
16 ISplashScreenState current_state;
17
18 public SplashScreenPresenter() : this(new IntervalTimer(), new SplashScreenView()) {}
19
20 public SplashScreenPresenter(ITimer timer, ISplashScreenView view)
21 {
22 this.timer = timer;
23 this.view = view;
24 }
25
26 public void run()
27 {
28 view.display();
29 current_state = new DisplayTheSplashScreen(timer, view, this);
30 }
31
32 public void Dispose()
33 {
34 current_state = new hide_the_splash_screen(timer, view, this);
35 }
36
37 public void notify()
38 {
39 current_state.update();
40 }
41 }
42}