Exemplo n.º 1
0
        public MainWindowViewModel(IApplicationConfig model, AuthenticationViewModel authentication, AuthorizationViewModel authorization, UserInterfaceViewModel ui, RateLimitsViewModel rate, IpDetectionViewModel ip,
                                   AuditingViewModel audit, EmailViewModel mail, HostingViewModel hosting, ActiveDirectoryConfigurationViewModel ad,
                                   JitConfigurationViewModel jit, LapsConfigurationViewModel laps, HelpViewModel help, BitLockerViewModel bitLocker, LicensingViewModel lic, HighAvailabilityViewModel havm, IEventAggregator eventAggregator, IDialogCoordinator dialogCoordinator, ILogger <MainWindowViewModel> logger, IShellExecuteProvider shellExecuteProvider, IWindowsServiceProvider windowsServiceProvider, IRegistryProvider registryProvider, ICertificateSynchronizationProvider certSyncProvider, IAmsLicenseManager licenseManager, IClusterProvider clusterProvider)
        {
            this.model = model;
            this.shellExecuteProvider = shellExecuteProvider;
            this.logger                 = logger;
            this.dialogCoordinator      = dialogCoordinator;
            this.windowsServiceProvider = windowsServiceProvider;
            this.hosting                = hosting;
            this.registryProvider       = registryProvider;
            this.eventAggregator        = eventAggregator;
            this.certSyncProvider       = certSyncProvider;
            this.dialogCoordinator      = dialogCoordinator;
            this.licenseManager         = licenseManager;
            this.clusterProvider        = clusterProvider;
            this.clusterWaitSemaphore   = new SemaphoreSlim(0, 1);

            this.eventAggregator.Subscribe(this);
            this.DisplayName = Constants.AppName;

            this.Items.Add(hosting);
            this.Items.Add(authentication);
            this.Items.Add(ui);
            this.Items.Add(mail);
            this.Items.Add(rate);
            this.Items.Add(ip);
            this.Items.Add(ad);
            this.Items.Add(audit);
            this.Items.Add(laps);
            this.Items.Add(jit);
            this.Items.Add(bitLocker);
            this.Items.Add(authorization);
            this.Items.Add(lic);
            this.Items.Add(havm);

            this.OptionItems = new BindableCollection <PropertyChangedBase> {
                help
            };

            this.ActiveItem = this.Items.First();

            this.UpdateIsConfigured();
            this.SetupClusterMonitor();
        }