Changeset 3006 for branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/PluginListView.cs
- Timestamp:
- 03/11/10 18:23:52 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/PluginListView.cs
r2860 r3006 27 27 Caption = "Plugins"; 28 28 29 using (var client = new PluginDeploymentService.UpdateClient()) {30 serverUrlTextBox.Text = client.Endpoint.Address.ToString();31 }32 33 29 localAndServerPlugins = new Dictionary<IPluginDescription, PluginDeploymentService.PluginDescription>(); 34 30 … … 79 75 void updateServerPluginsWorker_DoWork(object sender, DoWorkEventArgs e) { 80 76 try { 81 using (var client = new PluginDeploymentService.UpdateClient()) { 82 e.Result = client.GetPlugins(); 83 e.Cancel = false; 84 } 77 var client = PluginDeploymentService.UpdateClientFactory.CreateClient(); 78 e.Result = client.GetPlugins(); 79 e.Cancel = false; 85 80 } 86 81 catch (EndpointNotFoundException) { … … 110 105 try { 111 106 var selectedPlugins = (IEnumerable<IPluginDescription>)e.Argument; 112 using (PluginDeploymentService.AdminClient adminClient = new PluginDeploymentService.AdminClient()) { 113 114 foreach (var plugin in IteratePlugins(selectedPlugins)) { 115 adminClient.DeployPlugin(MakePluginDescription(plugin), CreateZipPackage(plugin)); 116 } 107 PluginDeploymentService.AdminClient adminClient = PluginDeploymentService.AdminClientFactory.CreateClient(); 108 109 foreach (var plugin in IteratePlugins(selectedPlugins)) { 110 adminClient.DeployPlugin(MakePluginDescription(plugin), CreateZipPackage(plugin)); 117 111 } 118 112 e.Cancel = false; … … 142 136 143 137 private void connectButton_Click(object sender, EventArgs e) { 144 if (connectButton.Text == "Connect") { 145 DisableControl(); 146 RefreshPluginsAsync(); 147 } else { 148 UpdateControlsDisconnectedState(); 149 } 138 var connectionSetupView = new ConnectionSetupView(); 139 connectionSetupView.Show(); 150 140 } 151 141 … … 226 216 var dependencies = from dep in plugin.Dependencies 227 217 select MakePluginDescription(dep); 228 if (string.IsNullOrEmpty(plugin.ContactName) || string.IsNullOrEmpty(plugin.ContactEmail)) { 229 return new PluginDeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies); 230 } else return new PluginDeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies, plugin.ContactName, plugin.ContactEmail, plugin.LicenseText); 218 return new PluginDeploymentService.PluginDescription(plugin.Name, plugin.Version, dependencies, plugin.ContactName, plugin.ContactEmail, plugin.LicenseText); 231 219 } 232 220 … … 256 244 257 245 private void UpdateControlsDisconnectedState() { 258 connectButton.Text = "Connect"; 259 serverUrlTextBox.Enabled = true; 260 serverUrlLabel.Enabled = true; 246 connectionSetupButton.Text = "Connect"; 261 247 refreshButton.Enabled = false; 262 248 … … 269 255 270 256 private void UpdateControlsConnectedState() { 271 connectButton.Text = "Disconnect"; 272 connectButton.Enabled = true; 273 serverUrlTextBox.Enabled = false; 274 serverUrlLabel.Enabled = false; 257 connectionSetupButton.Text = "Disconnect"; 258 connectionSetupButton.Enabled = true; 275 259 refreshButton.Enabled = true; 276 260 listView.Enabled = true;
Note: See TracChangeset
for help on using the changeset viewer.