private void ReloadTargets() { this.ExplorerTree.Items.Clear(); var targets = CloudTargetManager.GetTargets(); foreach (var target in targets) { ExplorerTree.Items.Add(new CloudFoundryTarget(target)); } }
private async Task Delete() { var answer = MessageBoxHelper.WarningQuestion( string.Format( CultureInfo.InvariantCulture, "Are you sure you want to delete target '{0}'?", this.target.DisplayName)); if (answer == System.Windows.Forms.DialogResult.Yes) { await Task.Factory.StartNew(() => CloudTargetManager.RemoveTarget(this.target)); } }
private void AddTargetButton_Click(object sender, RoutedEventArgs e) { var loginForm = new LogOnForm(); var result = loginForm.ShowDialog(); if (result == true) { var target = loginForm.CloudTarget; if (target != null) { CloudTargetManager.SaveTarget(target); CloudCredentialsManager.Save(target.TargetUrl, target.Email, loginForm.Credentials.Password); this.ReloadTargets(); } } }
public PublishProfileEditorResources(PublishProfile publishProfile, CancellationToken cancellationToken) { this.selectedPublishProfile = publishProfile; this.selectedPublishProfile.PropertyChanged += this.PublishProfile_PropertyChanged; this.cancellationToken = cancellationToken; this.CloudTargets = CloudTargetManager.GetTargets(); var publishProfiles = new List <PublishProfile>(); var publishDirectory = Directory.GetParent(this.selectedPublishProfile.Path); if (Directory.Exists(publishDirectory.FullName)) { foreach (var file in publishDirectory.GetFiles()) { if (file.Name.EndsWith(PushEnvironment.Extension, StringComparison.OrdinalIgnoreCase)) { try { var selectedProject = VsUtils.GetSelectedProject(); PushEnvironment env = new PushEnvironment(selectedProject); env.ProfileFilePath = file.FullName; var profile = PublishProfile.Load(env); publishProfiles.Add(profile); } catch (Exception ex) { // Ignore profiles that cannot be loaded. Logger.Warning(string.Format(CultureInfo.InvariantCulture, "Cloud not load profile from {0}: {1}", file.Name, ex)); } } } } this.PublishProfiles = publishProfiles.ToArray(); }