public static void RestartServerWindow(BaseFileUpdateHandler updatehandler)
        {
            var vm           = new UpdateCompleteViewModel(updatehandler);
            var UpdateWindow = new UpdateCompleteView {
                DataContext = vm
            };

            vm.OnRequestClose += (s, e) => UpdateWindow.Close();
            UpdateWindow.Owner = Application.Current.MainWindow;
            UpdateWindow.ShowDialog();
        }
        public static void UpdateAgentFiles(string agentPath)
        {
            BaseFileUpdateHandler updater = new BaseFileUpdateHandler(new ToscaInstallation(), ToscaConfigFilesViewModel.ToscaConfigFiles);

            updater.LoadAppUpdaterBehaviorList(agentPath, new UpdateDexAgentSettingsFactory());
            updater.UpdateAll();
            Trace.WriteLine("Update process complete.");
            if (updater.UpdateSucceeded())
            {
                Trace.WriteLine("Update process complete.");
                ToscaConfigFilesViewModel.ToscaConfigFiles.ApplyAgentButton = "👍";
            }
        }
        public static void UpdateToscaServerFiles(string serverpath)
        {
            BaseFileUpdateHandler updater = new BaseFileUpdateHandler(new ToscaInstallation(), ToscaConfigFilesViewModel.ToscaConfigFiles);

            updater.LoadAppUpdaterBehaviorList(serverpath, new UpdateToscaServerSettingsFactory());
            updater.UpdateAll();
            if (updater.UpdateSucceeded())
            {
                Trace.WriteLine("Update process complete.");
                ToscaConfigFilesViewModel.ToscaConfigFiles.ApplyServerButton = "👍";
            }
            else
            {
                //TODO:handle failed update
            }
            RestartServerWindow(updater);
        }
Example #4
0
 public UpdateCompleteViewModel(BaseFileUpdateHandler updateHandler)
 {
     UpdateCompleteModel = new UpdateCompleteModel();
     _updateHandler      = updateHandler;
 }