Changeset 7357
- Timestamp:
- 01/18/12 11:51:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/AddAzureServiceDialog.cs
r7354 r7357 2 2 using System.Collections.Generic; 3 3 using System.ComponentModel; 4 using System.Diagnostics;5 4 using System.Windows.Forms; 6 5 using HeuristicLab.Clients.Hive.CloudManager.Model; … … 23 22 InitializeComponent(); 24 23 isInitializing = true; 24 bwCompleted = true; 25 25 26 26 this.subscriptions = new BindingList<Subscription>(subs); … … 49 49 protected override void OnFormClosing(FormClosingEventArgs e) { 50 50 if (!bwCompleted) { 51 worker.CancelAsync(); 52 this.Enabled = false; 51 SetAllControlsEnabled(this, false); 53 52 e.Cancel = true; 54 53 closePending = true; … … 71 70 foreach (Control ctrl in frm.Controls) { 72 71 if (!(ctrl is ProgressBar)) { 73 this.Invoke((MethodInvoker)delegate { ctrl.Enabled = isEnabled; });72 ctrl.Enabled = isEnabled; 74 73 } 75 74 } … … 104 103 // checked == false 105 104 SetGroupBoxControlsEnabled(gbNewHostedService, false); 106 if (hostedServices == null) {105 if (hostedServices.Count == 0) { 107 106 cbNewHostedService.Checked = true; 108 107 } … … 114 113 Subscription item = (Subscription)cmbChooseSubscription.SelectedItem; 115 114 if (item != null) { 115 bwCompleted = false; 116 116 progressBar.Visible = true; 117 SetAllControlsEnabled(this, false); 117 118 worker.RunWorkerAsync(item); 118 119 } … … 123 124 using (var form = new AddCertificate()) { 124 125 form.ShowDialog(); 125 Debug.WriteLine("End - AddCertificateDialog");126 126 } 127 127 } … … 144 144 } 145 145 } 146 147 146 } 148 147 } … … 150 149 private void UpdateTask(object sender, DoWorkEventArgs e) { 151 150 try { 152 SetAllControlsEnabled(this, false);153 154 151 Subscription item = (Subscription)e.Argument; 155 152 item = CloudManagerClient.Instance.AzureProvider.GetSubscriptionInfo(item.SubscriptionID, item.CertificateThumbprint); … … 163 160 this.Invoke((MethodInvoker)delegate { UpdateBindingList<string>(locations, locs); }); 164 161 this.Invoke((MethodInvoker)delegate { UpdateBindingList<AffinityGroup>(affinityGroups, groups); }); 165 166 SetAllControlsEnabled(this, true);167 162 } 168 163 catch (Exception ex) { … … 172 167 173 168 private void WorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 174 this.Invoke((MethodInvoker)delegate { progressBar.Visible = false; }); 169 SetAllControlsEnabled(this, true); 170 progressBar.Visible = false; 175 171 bwCompleted = true; 176 172 if (closePending) {
Note: See TracChangeset
for help on using the changeset viewer.