Interaction logic for UpdateVersionDialog.xaml
Inheritance: System.Windows.Window
示例#1
0
        private async void OnUpdateVersion(object sender, RoutedEventArgs e)
        {
            StorageAccountConnectionInfo connectionInfo = GetCurrentConnection();
            string               appId                  = GetSelectedAppId();
            string               version                = GetSelectedVersion();
            AppIdentity          appIdentity            = new AppIdentity(appId, version);
            IEnumerable <string> availableDeploymentIds = _deploymentConfig.ListDeploymentIds(appIdentity);
            UpdateVersionDialog  dialog                 = new UpdateVersionDialog(appId, version, availableDeploymentIds);

            if (dialog.ShowDialog() == true)
            {
                string               newVersion            = dialog.NewVersion;
                AppIdentity          newAppIdentity        = new AppIdentity(appIdentity.Id, newVersion);
                IEnumerable <string> selectedDeploymentIds = dialog.SelectedDeploymentIds;
                foreach (string deploymentId in selectedDeploymentIds)
                {
                    await AddApplication(newAppIdentity, deploymentId, dialog.BinariesPath);

                    _deploymentConfig = _deploymentConfig.RemoveApplication(appIdentity, deploymentId);
                }

                SaveLocalDeploymentConfig(connectionInfo);
            }
        }
示例#2
0
        private async void OnUpdateVersion(object sender, RoutedEventArgs e)
        {
            StorageAccountConnectionInfo connectionInfo = GetCurrentConnection();
            string appId = GetSelectedAppId();
            string version = GetSelectedVersion();
	        AppIdentity appIdentity = new AppIdentity(appId, version);
			IEnumerable<string> availableDeploymentIds = _deploymentConfig.ListClusters(appIdentity);
            UpdateVersionDialog dialog = new UpdateVersionDialog(appId, version, availableDeploymentIds);
            if (dialog.ShowDialog() == true)
            {
                string newVersion = dialog.NewVersion;
                AppIdentity newAppIdentity = new AppIdentity(appIdentity.Id, newVersion);
                IEnumerable<string> selectedDeploymentIds = dialog.SelectedDeploymentIds;
                foreach (string deploymentId in selectedDeploymentIds)
                {
                    await AddApplication(newAppIdentity, deploymentId, dialog.BinariesPath);
                    _deploymentConfig = _deploymentConfig.RemoveApplication(appIdentity, deploymentId);
                }

                SaveLocalDeploymentConfig(connectionInfo);
            }
        }