public VeeamWorkerManager( IPortalService portalService, IPortalAuthenticationService authService, IVeeamManager veeamManager) : base(portalService, authService) { _veeamManager = veeamManager; }
public UserWorkerManager( IPortalService portalService, IPortalAuthenticationService authService, IActiveDirectoryManager activeDirectoryManager ) : base(portalService, authService) { _activeDirectoryManager = activeDirectoryManager; }
public VeeamManager(IPortalAuthenticationService authService) { _authService = authService; }
public MainWindowViewModel() { // resolve dependencies _settingManager = IocManager.Instance.Resolve <ISettingManager>(); _authService = IocManager.Instance.Resolve <IPortalAuthenticationService>(); try { _serviceController = new ServiceController("LicenseMonitoringSystem"); if (_serviceController == null) { ServiceInstalled = false; ServiceStatus = "Program not installed."; } else { ServiceInstalled = true; ServiceStatus = _serviceController.Status.ToString(); } } catch (Exception ex) { ServiceInstalled = false; ServiceStatus = ex.Message; } // set initial values AccountId = _authService.GetAccount(); DeviceId = _authService.GetDevice(); // listen for changes this.Changed(p => p.AccountId) .Throttle(TimeSpan.FromMilliseconds(500)) .ObserveOnDispatcher() .Subscribe(accountId => { IsBusy = true; if (_canChangeAccountId) { var prev = _authService.GetAccount(); if (prev != AccountId) { PendingChanges = true; } } Debug.WriteLine($"Account ID: {accountId}"); _settingManager.ChangeSettingForApplication(AppSettingNames.AutotaskAccountId, accountId.ToString()); IsBusy = false; _canChangeAccountId = true; }) .DisposeWith(_disposable); this.Changed(p => p.DeviceId) .Throttle(TimeSpan.FromMilliseconds(500)) .ObserveOnDispatcher() .Subscribe(deviceId => { IsBusy = true; if (_canChangeDeviceId) { var prev = _authService.GetDevice(); if (prev != DeviceId) { PendingChanges = true; } } Debug.WriteLine($"Device ID: {deviceId}"); _settingManager.ChangeSettingForApplication(AppSettingNames.CentrastageDeviceId, deviceId.ToString()); IsBusy = false; _canChangeDeviceId = true; }) .DisposeWith(_disposable); PendingChanges = false; }
public PortalService(IPortalAuthenticationService authService) { _authService = authService; }
protected WorkerManagerBase(IPortalService portalService, IPortalAuthenticationService authService) { PortalService = portalService; AuthService = authService; }