public DeleteServiceControlInstanceCommand(IWindowManagerEx windowManager, IEventAggregator eventAggregator, ServiceControlInstanceInstaller installer, Func <DeleteServiceControlConfirmationViewModel> deleteInstanceConfirmation) : base(model => model != null)
 {
     this.windowManager = windowManager;
     this.deleteInstanceConfirmation = deleteInstanceConfirmation;
     this.eventAggregator            = eventAggregator;
     this.installer = installer;
 }
        public InstanceDetailsViewModel(
            BaseService instance,
            EditServiceControlAuditInstanceCommand showAuditEditScreenCommand,
            EditServiceControlInstanceCommand showServiceControlEditScreenCommand,
            EditMonitoringInstanceCommand showEditMonitoringScreenCommand,
            UpgradeServiceControlInstanceCommand upgradeServiceControlCommand,
            UpgradeMonitoringInstanceCommand upgradeMonitoringCommand,
            UpgradeAuditInstanceCommand upgradeAuditCommand,
            AdvancedMonitoringOptionsCommand advancedOptionsMonitoringCommand,
            AdvancedServiceControlOptionsCommand advancedOptionsServiceControlCommand,
            ServiceControlInstanceInstaller serviceControlinstaller,
            ServiceControlAuditInstanceInstaller serviceControlAuditInstaller,
            MonitoringInstanceInstaller monitoringinstaller)
        {
            OpenUrl         = new OpenURLCommand();
            CopyToClipboard = new CopyToClipboardCommand();
            StartCommand    = Command.Create(() => StartService());
            StopCommand     = Command.Create(() => StopService());

            ServiceInstance = instance;

            if (instance.GetType() == typeof(ServiceControlInstance))
            {
                ServiceControlInstance     = (ServiceControlInstance)instance;
                NewVersion                 = serviceControlinstaller.ZipInfo.Version;
                EditCommand                = showServiceControlEditScreenCommand;
                UpgradeToNewVersionCommand = upgradeServiceControlCommand;
                AdvancedOptionsCommand     = advancedOptionsServiceControlCommand;
                InstanceType               = InstanceType.ServiceControl;
                return;
            }

            if (instance.GetType() == typeof(MonitoringInstance))
            {
                MonitoringInstance         = (MonitoringInstance)instance;
                NewVersion                 = monitoringinstaller.ZipInfo.Version;
                EditCommand                = showEditMonitoringScreenCommand;
                UpgradeToNewVersionCommand = upgradeMonitoringCommand;
                AdvancedOptionsCommand     = advancedOptionsMonitoringCommand;
                InstanceType               = InstanceType.Monitoring;
                return;
            }

            if (instance.GetType() == typeof(ServiceControlAuditInstance))
            {
                ServiceControlAuditInstance = (ServiceControlAuditInstance)instance;
                NewVersion  = serviceControlAuditInstaller.ZipInfo.Version;
                EditCommand = showAuditEditScreenCommand;
                UpgradeToNewVersionCommand = upgradeAuditCommand;
                AdvancedOptionsCommand     = advancedOptionsServiceControlCommand;
                InstanceType = InstanceType.ServiceControlAudit;
                return;
            }

            throw new Exception("Unknown instance type");
        }
 public UpgradeAuditInstanceCommand(
     IWindowManagerEx windowManager,
     IEventAggregator eventAggregator,
     ServiceControlInstanceInstaller serviceControlInstaller,
     ServiceControlAuditInstanceInstaller serviceControlAuditInstaller)
 {
     this.windowManager                = windowManager;
     this.eventAggregator              = eventAggregator;
     this.serviceControlInstaller      = serviceControlInstaller;
     this.serviceControlAuditInstaller = serviceControlAuditInstaller;
 }
Example #4
0
 public UpgradeServiceControlInstanceCommand(
     IWindowManagerEx windowManager,
     IEventAggregator eventAggregator,
     ServiceControlInstanceInstaller serviceControlInstaller,
     ServiceControlAuditInstanceInstaller serviceControlAuditInstaller,
     Func <string, AddNewAuditInstanceViewModel> auditUpgradeViewModelFactory)
 {
     this.windowManager                = windowManager;
     this.eventAggregator              = eventAggregator;
     this.serviceControlInstaller      = serviceControlInstaller;
     this.serviceControlAuditInstaller = serviceControlAuditInstaller;
     this.auditUpgradeViewModelFactory = auditUpgradeViewModelFactory;
 }
 public ServiceControlEditAttachment(IWindowManagerEx windowManager, IEventAggregator eventAggregator, ServiceControlInstanceInstaller installer)
 {
     this.windowManager   = windowManager;
     this.installer       = installer;
     this.eventAggregator = eventAggregator;
 }
 public ServiceControlAddAttachment(IWindowManagerEx windowManager, IEventAggregator eventAggregator, ServiceControlInstanceInstaller serviceControlinstaller, ServiceControlAuditInstanceInstaller serviceControlAuditInstaller)
 {
     this.windowManager                = windowManager;
     this.serviceControlInstaller      = serviceControlinstaller;
     this.serviceControlAuditInstaller = serviceControlAuditInstaller;
     this.eventAggregator              = eventAggregator;
 }
Example #7
0
 public AddServiceControlInstanceCommand(IWindowManagerEx windowManager, Func <ServiceControlAddViewModel> addInstance, ServiceControlInstanceInstaller installer) : base(null)
 {
     this.windowManager = windowManager;
     this.addInstance   = addInstance;
     this.installer     = installer;
 }