Exemplo n.º 1
0
 public MainWindowViewModel(ICurrentVersionProvider currentVersionProvider, IMessenger messenger, IStateHandlerViewModel stateHandlerViewModel, ILanguageService languageService, IGrabberService grabberService, IStorageCleanerService storageCleanerService, IConfigurationService configurationService, IServerLogService serverLogService, ILogDumpService logDumpService)
 {
     this.StateHandlerViewModel  = stateHandlerViewModel;
     this._messenger             = messenger;
     this._languageService       = languageService;
     this._grabberService        = grabberService;
     this._storageCleanerService = storageCleanerService;
     this._configurationService  = configurationService;
     this._serverLogService      = serverLogService;
     this._logDumpService        = logDumpService;
     this.Version = currentVersionProvider.Version.ToString(3);
     messenger.Register <OnClosingProgramRequested>((object)this, new Action <OnClosingProgramRequested>(this.OnClosingProgramRequested));
     this.OnLanguageChanged((OnLanguageChanged)null);
     messenger.Register <OnLanguageChanged>((object)this, new Action <OnLanguageChanged>(this.OnLanguageChanged));
     messenger.Register <OnNewGrabSettings>((object)this, new Action <OnNewGrabSettings>(this.OnNewGrabSettings));
     messenger.Register <OnSuccessfulHealthCheck>((object)this, new Action <OnSuccessfulHealthCheck>(this.OnSuccessfulHealthCheck));
     messenger.Register <OnSuccessfulLogin>((object)this, new Action <OnSuccessfulLogin>(this.OnSuccessfulLogin));
 }
Exemplo n.º 2
0
 public LoginViewModel(IMessenger messenger, IBoardingPassValidator boardingPassValidator, ILanguageService languageService, IConfigurationService configurationService, ITimerService loginAttemptsTimer, IBoardingPassStorageService boardingPassStorageService, IFlexClient flexClient, IHeartbeatService heartbeatService, IStorageCleanerService storageCleanerService)
 {
     this._messenger                  = messenger;
     this._boardingPassValidator      = boardingPassValidator;
     this._languageService            = languageService;
     this._configurationService       = configurationService;
     this._loginAttemptsTimer         = loginAttemptsTimer;
     this._boardingPassStorageService = boardingPassStorageService;
     this._flexClient                 = flexClient;
     this._heartbeatService           = heartbeatService;
     this._storageCleanerService      = storageCleanerService;
     this._messenger.Register <OnSuccessfulHealthCheck>((object)this, new Action <OnSuccessfulHealthCheck>(this.OnSuccessfulHealthCheck));
     this.UpdateText((OnLanguageChanged)null);
     this._messenger.Register <OnLanguageChanged>((object)this, new Action <OnLanguageChanged>(this.UpdateText));
     this._messenger.Register <OnLoginErrorPopupClosed>((object)this, new Action <OnLoginErrorPopupClosed>(this.OnLoginErrorPopupClosed));
     this.LoginCommand = (ICommand) new RelayCommand((Action <object>)(c => this.LoginClick()), (Predicate <object>)null);
     this._loginAttemptsTimer.AutoReset = false;
     this._loginAttemptsTimer.Interval  = (double)(configurationService.BoardingPassLoginLockDurationInSeconds * 1000);
     this._loginAttemptsTimer.Elapsed  += (ElapsedEventHandler)((s, e) =>
     {
         DispatcherHelper.CheckBeginInvokeOnUI((Action)(() => this.CanLogin = true));
         this.LoginAttemptsCounter = 0;
     });
 }