예제 #1
0
 public EmailViewModel(EmailOptions model, RandomNumberGenerator rng, INotifiableEventPublisher eventPublisher)
 {
     this.model       = model;
     this.rng         = rng;
     this.DisplayName = "Email";
     eventPublisher.Register(this);
 }
 public SecurityDescriptorTargetsViewModel(IList <SecurityDescriptorTarget> model, SecurityDescriptorTargetViewModelFactory factory, IDialogCoordinator dialogCoordinator, INotifiableEventPublisher eventPublisher)
 {
     this.factory           = factory;
     this.Model             = model;
     this.DialogCoordinator = dialogCoordinator;
     this.ViewModels        = new BindableCollection <SecurityDescriptorTargetViewModel>(this.Model.Select(factory.CreateViewModel));
     eventPublisher.Register(this);
 }
예제 #3
0
 public UserInterfaceViewModel(UserInterfaceOptions model, IDialogCoordinator dialogCoordinator, IAppPathProvider appPathProvider, INotifiableEventPublisher eventPublisher, ILogger <UserInterfaceViewModel> logger)
 {
     this.appPathProvider   = appPathProvider;
     this.dialogCoordinator = dialogCoordinator;
     this.logger            = logger;
     this.model             = model;
     this.LoadImage();
     eventPublisher.Register(this);
 }
 protected NotificationChannelDefinitionsViewModel(IList <TModel> model, NotificationChannelDefinitionViewModelFactory <TModel, TViewModel> factory, IDialogCoordinator dialogCoordinator, IEventAggregator eventAggregator, INotifiableEventPublisher eventPublisher)
 {
     this.factory           = factory;
     this.Model             = model;
     this.EventAggregator   = eventAggregator;
     this.DialogCoordinator = dialogCoordinator;
     this.ViewModels        = new BindableCollection <TViewModel>(this.Model.Select(t => this.factory.CreateViewModel(t)));
     eventPublisher.Register(this);
 }
예제 #5
0
 public IpDetectionViewModel(ForwardedHeadersAppOptions model, IDialogCoordinator dialogCoordinator, INotifiableEventPublisher eventPublisher)
 {
     this.DisplayName       = "IP address detection";
     this.model             = model;
     this.dialogCoordinator = dialogCoordinator;
     this.model.KnownNetworks ??= new List <string>();
     this.model.KnownProxies ??= new List <string>();
     this.KnownProxies  = new BindableCollection <string>(model.KnownProxies);
     this.KnownNetworks = new BindableCollection <string>(model.KnownNetworks);
     eventPublisher.Register(this);
 }
예제 #6
0
        public UserInterfaceViewModel(UserInterfaceOptions model, IDialogCoordinator dialogCoordinator, IAppPathProvider appPathProvider, INotifiableEventPublisher eventPublisher, ILogger <UserInterfaceViewModel> logger)
        {
            this.appPathProvider   = appPathProvider;
            this.dialogCoordinator = dialogCoordinator;
            this.logger            = logger;
            this.model             = model;
            this.DisplayName       = "User interface";
            model.PhoneticSettings ??= new PhoneticSettings();

            eventPublisher.Register(this);
        }
        public NotificationChannelSelectionViewModel(AuditNotificationChannels model, INotificationSubscriptionProvider subscriptionProvider, IEventAggregator eventAggregator, INotifiableEventPublisher eventPublisher)
        {
            this.Model = model;

            this.SuccessSubscriptions = subscriptionProvider.GetSubscriptions(this.Model.OnSuccess);
            this.FailureSubscriptions = subscriptionProvider.GetSubscriptions(this.Model.OnFailure);

            this.AvailableSuccessSubscriptions = new BindableCollection <SubscriptionViewModel>(subscriptionProvider.Subscriptions.Except(this.SuccessSubscriptions));
            this.AvailableFailureSubscriptions = new BindableCollection <SubscriptionViewModel>(subscriptionProvider.Subscriptions.Except(this.FailureSubscriptions));

            eventAggregator.Subscribe(this);
            eventPublisher.Register(this);
        }
예제 #8
0
        public RateLimitsViewModel(RateLimitOptions model, INotifiableEventPublisher eventPublisher)
        {
            this.model = model;
            if (this.model.PerUser == null)
            {
                this.model.PerUser = new RateLimitThresholds();
            }

            if (this.model.PerIP == null)
            {
                this.model.PerIP = new RateLimitThresholds();
            }

            eventPublisher.Register(this);
        }
        public HostingViewModel(HostingOptions model, IDialogCoordinator dialogCoordinator, IServiceSettingsProvider serviceSettings, ILogger <HostingViewModel> logger, IModelValidator <HostingViewModel> validator, IAppPathProvider pathProvider, INotifiableEventPublisher eventPublisher)
        {
            this.logger                 = logger;
            this.pathProvider           = pathProvider;
            this.OriginalModel          = model;
            this.WorkingModel           = this.CloneModel(model);
            this.dialogCoordinator      = dialogCoordinator;
            this.serviceSettings        = serviceSettings;
            this.Certificate            = this.GetCertificate();
            this.OriginalCertificate    = this.Certificate;
            this.ServiceAccount         = this.serviceSettings.GetServiceAccount();
            this.OriginalServiceAccount = this.ServiceAccount;
            this.ServiceStatus          = this.serviceSettings.ServiceController.Status.ToString();
            this.DisplayName            = "Web hosting";
            this.Validator              = validator;

            eventPublisher.Register(this);
        }