public WorkSpaceViewModel(IMessenger messenger, ISelectDirectoryService selectDirectoryService, IWorkspaceStorageService workspaceStorageService, IAssignmentFileService assignmentFileService, IDirectoryService directoryService, ILanguageService languageService, IPinCodeStorageService pinCodeStorageService, IBackupService backupService, ISafePathService safePathService, IPinCodeValidator pinCodeValidator, ITimerService examStartsTimer, IDirectoryAccessValidator directoryAccessValidator, ITimerService lockUiOnInvalidPinCodeTimerService, IBoardingPassStorageService boardingPassStorageService, ITimerService assignmentFilesRedownloadTimerService, ILoggerService loggerService) { this._messenger = messenger; this._selectDirectoryService = selectDirectoryService; this._workspaceStorageService = workspaceStorageService; this._assignmentFileService = assignmentFileService; this._directoryService = directoryService; this._languageService = languageService; this._pinCodeStorageService = pinCodeStorageService; this._backupService = backupService; this._safePathService = safePathService; this._pinCodeValidator = pinCodeValidator; this._examStartsTimer = examStartsTimer; this._directoryAccessValidator = directoryAccessValidator; this._lockUiOnInvalidPinCodeTimerService = lockUiOnInvalidPinCodeTimerService; this._boardingPassStorageService = boardingPassStorageService; this._assignmentFilesRedownloadTimerService = assignmentFilesRedownloadTimerService; this._loggerService = loggerService; this._examStartsTimer.AutoReset = false; this._examStartsTimer.Elapsed += (ElapsedEventHandler)((sender, args) => this.ExamHasStarted()); this._assignmentFilesRedownloadTimerService.AutoReset = false; this._assignmentFilesRedownloadTimerService.Elapsed += new ElapsedEventHandler(this.AssignmentFilesRedownloadTimerService_Elapsed); this._assignmentFilesRedownloadTimerService.Interval = 600000.0; this.SetWorkspacePathCommand = (ICommand) new RelayCommand((Action <object>)(c => this.SetWorkspaceClick()), (Predicate <object>)null); this.ShowUnlockAssignmentFilesCommand = (ICommand) new RelayCommand((Action <object>)(c => this.ShowUnlockAssignmentFilesClick()), (Predicate <object>)null); this.UpdateLanguage((OnLanguageChanged)null); messenger.Register <OnLanguageChanged>((object)this, new Action <OnLanguageChanged>(this.UpdateLanguage)); messenger.Register <OnTimeLeftUntilExamStarts>((object)this, new Action <OnTimeLeftUntilExamStarts>(this.OnTimeLeftUntilExamStarts)); messenger.Register <OnExaminationDataLoaded>((object)this, new Action <OnExaminationDataLoaded>(this.OnExaminationDataLoaded)); messenger.Register <OnPinCodeLoginSuccessful>((object)this, new Action <OnPinCodeLoginSuccessful>(this.OnPinCodeLoginSuccessful)); messenger.Register <OnPinCodeLoginForceContinue>((object)this, new Action <OnPinCodeLoginForceContinue>(this.OnPinCodeLoginForceContinue)); messenger.Register <OnExaminationUrlLoaded>((object)this, new Action <OnExaminationUrlLoaded>(this.OnExaminationUrlLoaded)); }
private void ShowUnlockAssignmentFilesClick() { IMessenger messenger1 = this._messenger; OnPinCodePopupOpened message = new OnPinCodePopupOpened(); IMessenger messenger2 = this._messenger; IPinCodeValidator pinCodeValidator = this._pinCodeValidator; IAssignmentFileService assignmentFileService = this._assignmentFileService; ILanguageService languageService = this._languageService; ITimerService codeTimerService = this._lockUiOnInvalidPinCodeTimerService; IEnumerable <AssignmentFileMetadata> assignmentFileMetadatas = this.AssignmentFileMetadatas; int num = assignmentFileMetadatas != null ? (assignmentFileMetadatas.Any <AssignmentFileMetadata>() ? 1 : 0) : 0; ClickablePathViewModel clickablePathViewModel = this.ClickablePathViewModel; message.PinCodePopupViewModel = new PinCodePopupViewModel(messenger2, pinCodeValidator, assignmentFileService, languageService, codeTimerService, num != 0, clickablePathViewModel); messenger1.Send <OnPinCodePopupOpened>(message); }
public PinCodePopupViewModel(IMessenger messenger, IPinCodeValidator pinCodeValidator, IAssignmentFileService assignmentFileService, ILanguageService languageService, ITimerService lockUiOnInvalidPinCodeTimerService, bool hasAssignmentFiles, ClickablePathViewModel clickablePathViewModel) { this._messenger = messenger; this._pinCodeValidator = pinCodeValidator; this._assignmentFileService = assignmentFileService; this._languageService = languageService; this._lockUiOnInvalidPinCodeTimerService = lockUiOnInvalidPinCodeTimerService; this._lockUiOnInvalidPinCodeTimerService.Stop(); this._lockUiOnInvalidPinCodeTimerService.AutoReset = false; this._lockUiOnInvalidPinCodeTimerService.Interval = 5000.0; this._lockUiOnInvalidPinCodeTimerService.Elapsed += new ElapsedEventHandler(this.LockUiOnInvalidPinCodeTimerService_Elapsed); this.UnlockAssignmentFilesCommand = (ICommand) new RelayCommand((Action <object>)(c => this.UnlockAssignmentFiles()), (Predicate <object>)null); this.ForceContinueCommand = (ICommand) new RelayCommand((Action <object>)(c => this.ForceContinue()), (Predicate <object>)null); this.UpdateLanguage(hasAssignmentFiles); this.ClickablePathViewModel = clickablePathViewModel; }