private void OnSelectedReportedDeploymentChanged(string deploymentId) { if (DeploymentsList.SelectedIndex != -1) { if (((DeploymentSummary)DeploymentsList.SelectedItem).Name == deploymentId) { return; } } int index = -1; DeploymentSummary selectedDeployment = null; foreach (DeploymentSummary ds in DeploymentsList.Items) { ++index; if (ds.Name == deploymentId) { selectedDeployment = ds; break; } } if (index == -1) { MessageBox.Show("Deployment is not found."); return; } DeploymentsList.SelectedIndex = index; DeploymentPanel.Show(selectedDeployment); }
// ToDo: This probably belongs in the DeploymentControl. private async void CreateDeploymentAsync() { foreach (var ds in _deploymentSummaries) { if (ds.AzureConfiguration.Id == DeploymentPanel.DeploymentName) { if (MessageBox.Show("Replace existing deployment?", "Warning!", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) { return; } RegistryManager registryManager = RegistryManager.CreateFromConnectionString(_connectionString); await registryManager.RemoveConfigurationAsync(ds.AzureConfiguration.Id); break; } } try { await DeploymentPanel.CreateDeploymentAsync(); MessageBox.Show("'" + DeploymentPanel.DeploymentName + "' has been saved successfully."); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); } RefreshDeploymentListAsync(); }
private void OnSelectedDeploymentChanged(object sender, RoutedEventArgs e) { if (DeploymentsList.SelectedIndex == -1) { return; } DeploymentPanel.Visibility = Visibility.Visible; DeploymentPanel.Show((DeploymentSummary)DeploymentsList.SelectedItem); }
public void SetConnectionString(string cs) { _connectionString = cs; DeploymentPanel.SetConnectionString(cs); }