public AuditViewModel( IFileSystemStoreService fileSystemStoreService, IShareAuditService shareAuditService, ISmbUtilitiesService smbUtilitiesService) { _fileSystemStoreService = fileSystemStoreService ?? throw new ArgumentNullException(nameof(fileSystemStoreService)); _shareAuditService = shareAuditService ?? throw new ArgumentNullException(nameof(shareAuditService)); _smbUtilitiesService = smbUtilitiesService ?? throw new ArgumentNullException(nameof(smbUtilitiesService)); _shareAuditService.Started += (sender, e) => { IsRunning = true; IsBusy = false; }; _shareAuditService.Stopped += async(sender, e) => { IsRunning = false; await _fileSystemStoreService.SaveProjectAsync(Project, ProjectPath); if (_runningInitialAutomaticAudit) { MessageBox.Show("The initial audit is now complete, you may proceed to review the results", "Initial Audit Complete", MessageBoxButton.OK, MessageBoxImage.Information); _runningInitialAutomaticAudit = false; } IsBusy = false; }; Export = new DelegateCommand(OnExport, CanExport).ObservesProperty(() => IsBusy).ObservesProperty(() => IsRunning); StartAudit = new DelegateCommand(OnStartAudit, CanStartAudit).ObservesProperty(() => IsBusy).ObservesProperty(() => IsRunning); StopAudit = new DelegateCommand(OnStopAudit, CanStopAudit).ObservesProperty(() => IsBusy).ObservesProperty(() => IsRunning); AuditFolder = new DelegateCommand(OnAuditFolder, CanAuditFolder).ObservesProperty(() => IsBusy).ObservesProperty(() => IsRunning).ObservesProperty(() => SelectedItem); RevealInExplorer = new DelegateCommand(OnRevealInExplorer, CanRevealInExplorer).ObservesProperty(() => IsBusy).ObservesProperty(() => SelectedItem); }
public WelcomeViewModel(IRegionManager regionManager, IFileSystemStoreService fileSystemStoreService) { _regionManager = regionManager ?? throw new ArgumentNullException(nameof(regionManager)); _fileSystemStoreService = fileSystemStoreService ?? throw new ArgumentNullException(nameof(fileSystemStoreService)); Banner = "/Dionach.ShareAudit.Modules.UserInterface;component/Images/Banner.png"; New = new DelegateCommand(OnNew, CanNew).ObservesProperty(() => IsBusy); Load = new DelegateCommand(OnLoad, CanLoad).ObservesProperty(() => IsBusy); Help = new DelegateCommand(OnHelp, CanHelp).ObservesProperty(() => IsBusy); }
public ImportScopeViewModel( IRegionManager regionManager, IFileSystemStoreService fileSystemStoreService, IImportScopeFromActiveDirectoryService importScopeFromActiveDirectoryService) { _regionManager = regionManager ?? throw new ArgumentNullException(nameof(regionManager)); _fileSystemStoreService = fileSystemStoreService ?? throw new ArgumentNullException(nameof(fileSystemStoreService)); _importScopeFromActiveDirectoryService = importScopeFromActiveDirectoryService ?? throw new ArgumentNullException(nameof(importScopeFromActiveDirectoryService)); Cancel = new DelegateCommand(OnCancel, CanCancel).ObservesProperty(() => IsBusy); Import = new DelegateCommand(OnImport, CanImport).ObservesProperty(() => IsBusy); }
public ConfigurationViewModel( IRegionManager regionManager, IFileSystemStoreService fileSystemStoreService, ICredentialsValidationService credentialsValidationService, IScopeValidationService scopeValidationService, IScopeNormalizationService scopeNormalizationService) { _regionManager = regionManager ?? throw new ArgumentNullException(nameof(regionManager)); _fileSystemStoreService = fileSystemStoreService ?? throw new ArgumentNullException(nameof(fileSystemStoreService)); _credentialsValidationService = credentialsValidationService ?? throw new ArgumentNullException(nameof(credentialsValidationService)); _scopeValidationService = scopeValidationService ?? throw new ArgumentNullException(nameof(scopeValidationService)); _scopeNormalizationService = scopeNormalizationService ?? throw new ArgumentNullException(nameof(scopeNormalizationService)); Cancel = new DelegateCommand(OnCancel, CanCancel).ObservesProperty(() => IsBusy); Next = new DelegateCommand(OnNext, CanNext).ObservesProperty(() => IsBusy); Import = new DelegateCommand(OnImport, CanImport).ObservesProperty(() => IsBusy).ObservesProperty(() => Project.Configuration.Scope); UseCurrentCredentials = new DelegateCommand(OnUseCurrentCredentials, CanUseCurrentCredentials).ObservesProperty(() => IsBusy); }