/// <summary> /// Initializes a new instance of the <see cref="DocumentRoutingAgentViewModel" /> class. /// </summary> /// <param name="dialogViewController">The dialog view controller.</param> /// <param name="settingsManager">The settings manager.</param> /// <param name="authorizationManager">The authorization manager.</param> /// <param name="errorHandlerStrategy">The error handler strategy.</param> public DocumentRoutingAgentViewModel( IDialogViewController dialogViewController, ISettingsManager settingsManager, IAuthorizationManager authorizationManager, Action <string> errorHandlerStrategy) { this.dialogViewController = dialogViewController ?? throw new ArgumentNullException(nameof(dialogViewController)); this.settingsManager = settingsManager ?? throw new ArgumentNullException(nameof(settingsManager)); this.errorHandlerStrategy = errorHandlerStrategy ?? throw new ArgumentNullException(nameof(errorHandlerStrategy)); this.authorizationManager = authorizationManager ?? throw new ArgumentNullException(nameof(authorizationManager)); this.ShowSettingsCommand = new DelegateCommand(this.ShowSettings); this.ShowPrintersCommand = new DelegateCommand(this.ShowPrinters); this.SignInCommand = new DelegateCommandAsync(this.SignIn, this.CanSignIn); this.SignOutCommand = new DelegateCommandAsync(this.SignOut); BindingOperations.EnableCollectionSynchronization(this.DocumentStatuses, this.documentStatusesLock); this.DocumentStatusManager = new DocumentStatusManager(this.DocumentStatuses); }
/// <summary> /// Initializes a new instance of the <see cref="DocumentRoutingAgentViewModel" /> class. /// </summary> /// <param name="dialogViewController">The dialog view controller.</param> /// <param name="settingsManager">The settings manager.</param> /// <param name="errorHandlerStrategy">The error handler strategy.</param> public DocumentRoutingAgentViewModel(IDialogViewController dialogViewController, ISettingsManager settingsManager, Action <string> errorHandlerStrategy) : this(dialogViewController, settingsManager, new AuthorizationManager(settingsManager), errorHandlerStrategy) { }