main
1using System.Threading;
2using solidware.financials.infrastructure.eventing;
3using solidware.financials.windows.ui.events;
4
5namespace solidware.financials.windows.ui.presenters
6{
7 public class StatusBarPresenter : ObservablePresenter<StatusBarPresenter>, Presenter, EventSubscriber<UpdateOnLongRunningProcess>
8 {
9 public string progress_message { get; set; }
10 public bool is_progress_bar_on { get; set; }
11 public string username { get; set; }
12 public string title { get; set; }
13
14 public void present()
15 {
16 username = Thread.CurrentPrincipal.Identity.Name;
17 title = "N/A";
18 }
19
20 public void notify(UpdateOnLongRunningProcess message)
21 {
22 progress_message = message.message;
23 is_progress_bar_on = message.percent_complete < 100;
24 update(x => x.progress_message, x => x.is_progress_bar_on);
25 }
26 }
27}