Esempio n. 1
0
        public static void RestartToscaServerDependencies()
        {
            List <ToscaServerService> toscaServerList = new List <ToscaServerService>()
            {
                new ToscaServerService("Tricentis.ServiceDiscovery"),
                new ToscaServerService("Tricentis.AuthenticationService"),
                new ToscaServerService("Tricentis.ProjectService"),
                new ToscaServerService("Tricentis.FileService"),
                new ToscaServerService("Tricentis.ToscaAutomationObjectService")
            };

            Trace.WriteLine("Restarting Tosca Server Dependencies:");
            UpdateCompleteViewModel.UpdateCompleteModel.TextBlockMessage     = string.Empty;
            UpdateCompleteViewModel.UpdateCompleteModel.AcceptButtonVisible  = false;
            UpdateCompleteViewModel.UpdateCompleteModel.DeclineButtonVisible = false;
            UpdateCompleteViewModel.UpdateCompleteModel.CloseButtonVisible   = false;

            ToscaServerServiceRestarter serviceRestarter = new ToscaServerServiceRestarter(toscaServerList);

            serviceRestarter.RestartComponentServices();

            ExecutableHelpers.RestartExe("RdpServer", ToscaConfigFilesViewModel.ToscaConfigFiles.ServerPath + @"\DEXRdpServer\ToscaRdpServer.exe");

            //updatehandler is assigned when files are updated. If 'Restart' is used without updating first, updater will be null. This is shit code.
            if (UpdateCompleteViewModel.GetUpdateHandler() != null)
            {
                UpdateCompleteViewModel.GetUpdateHandler().ClearUpdateBehaviorList();
            }
        }
        public static void RestartServerWindow()
        {
            var vm           = new UpdateCompleteViewModel();
            var UpdateWindow = new UpdateCompleteView {
                DataContext = vm
            };

            vm.OnRequestClose += (s, e) => UpdateWindow.Close();
            UpdateWindow.Owner = Application.Current.MainWindow;
            UpdateWindow.ShowDialog();
        }
Esempio n. 3
0
        public UpdateCompleteModel()
        {
            AcceptButton  = "Yes";
            DeclineButton = "No";
            CloseButton   = "Close";
            var updateHandler = UpdateCompleteViewModel.GetUpdateHandler();
            var appsUpdated   = (updateHandler != null) ? updateHandler.GetUpdatedAppsCount() : 0;
            var totalApps     = (updateHandler != null) ? updateHandler.GetAppCount() : 0;

            TextBlockMessage = (appsUpdated > 0) ?
                               $"{updateHandler.GetUpdatedFilesCount()} files updated.\nRestart Services to apply changes?" :
                               "Restart Tosca Server (IIS and Services)?";
            TextBlockLog         = string.Empty;
            AcceptButtonVisible  = true;
            DeclineButtonVisible = true;
            CloseButtonVisible   = false;
        }
 public UpdateCompleteView()
 {
     InitializeComponent();
     DataContext = new UpdateCompleteViewModel();
 }