Changeset 2816 for branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.cs
- Timestamp:
- 02/16/10 18:44:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.cs
r2804 r2816 8 8 using System.Windows.Forms; 9 9 using HeuristicLab.MainForm; 10 using HeuristicLab.PluginInfrastructure; 11 using UpdateService = HeuristicLab.PluginInfrastructure.PluginUpdateService; 10 using PluginDeploymentService = HeuristicLab.PluginInfrastructure.Advanced.DeploymentService; 12 11 13 12 namespace HeuristicLab.DeploymentService.AdminClient { … … 15 14 private BackgroundWorker refreshProductsWorker; 16 15 private BackgroundWorker uploadChangedProductsWorker; 17 private List< UpdateService.ProductDescription> products;18 private List< UpdateService.PluginDescription> plugins;19 private HashSet< UpdateService.ProductDescription> dirtyProducts;16 private List<PluginDeploymentService.ProductDescription> products; 17 private List<PluginDeploymentService.PluginDescription> plugins; 18 private HashSet<PluginDeploymentService.ProductDescription> dirtyProducts; 20 19 21 20 public ProductEditor() { … … 23 22 Caption = "Products"; 24 23 25 dirtyProducts = new HashSet< UpdateService.ProductDescription>();24 dirtyProducts = new HashSet<PluginDeploymentService.ProductDescription>(); 26 25 refreshProductsWorker = new BackgroundWorker(); 27 26 refreshProductsWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(refreshProductsWorker_RunWorkerCompleted); … … 34 33 35 34 void uploadChangedProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 36 var products = (IEnumerable< UpdateService.ProductDescription>)e.Argument;37 using (var adminClient = new AdminService.AdminClient()) {35 var products = (IEnumerable<PluginDeploymentService.ProductDescription>)e.Argument; 36 using (var adminClient = new PluginDeploymentService.AdminClient()) { 38 37 foreach (var product in products) { 39 38 adminClient.DeployProduct(product); … … 48 47 49 48 void refreshProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 50 var updateClient = new UpdateService.UpdateClient();49 var updateClient = new PluginDeploymentService.UpdateClient(); 51 50 e.Result = new object[] { updateClient.GetProducts(), updateClient.GetPlugins() }; 52 51 } 53 52 54 53 void refreshProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 55 this.products = new List< UpdateService.ProductDescription>(56 ( UpdateService.ProductDescription[])((object[])e.Result)[0]);57 this.plugins = new List< UpdateService.PluginDescription>(58 ( UpdateService.PluginDescription[])((object[])e.Result)[1]);54 this.products = new List<PluginDeploymentService.ProductDescription>( 55 (PluginDeploymentService.ProductDescription[])((object[])e.Result)[0]); 56 this.plugins = new List<PluginDeploymentService.PluginDescription>( 57 (PluginDeploymentService.PluginDescription[])((object[])e.Result)[1]); 59 58 60 59 UpdateProductsList(); … … 73 72 private void productsListBox_SelectedIndexChanged(object sender, EventArgs e) { 74 73 if (productsListBox.SelectedItems.Count == 0) return; 75 UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)((ListViewItem)productsListBox.SelectedItem).Tag;74 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)((ListViewItem)productsListBox.SelectedItem).Tag; 76 75 UpdateProductDetails(activeProduct); 77 76 } 78 77 79 private void UpdateProductDetails( UpdateService.ProductDescription activeProduct) {78 private void UpdateProductDetails(PluginDeploymentService.ProductDescription activeProduct) { 80 79 nameTextBox.Text = activeProduct.Name; 81 80 versionTextBox.Text = activeProduct.Version.ToString(); 82 81 83 82 pluginsList.Items.Clear(); 84 foreach ( UpdateService.PluginDescription pluginDesc in plugins) {83 foreach (PluginDeploymentService.PluginDescription pluginDesc in plugins) { 85 84 var matching = from p in activeProduct.Plugins 86 85 where p.Name == pluginDesc.Name … … 106 105 107 106 private void newProductButton_Click(object sender, EventArgs e) { 108 var newProduct = new UpdateService.ProductDescription("New product", new Version("0.0.0.0"));107 var newProduct = new PluginDeploymentService.ProductDescription("New product", new Version("0.0.0.0")); 109 108 ListViewItem item = CreateListViewItem(newProduct); 110 109 productsListBox.Items.Add(item); … … 112 111 } 113 112 114 private ListViewItem CreateListViewItem( UpdateService.ProductDescription productDescription) {113 private ListViewItem CreateListViewItem(PluginDeploymentService.ProductDescription productDescription) { 115 114 ListViewItem item = new ListViewItem(); 116 115 item.Text = productDescription.Name + " " + productDescription.Version; … … 127 126 private void nameTextBox_TextChanged(object sender, EventArgs e) { 128 127 ListViewItem activeItem = (ListViewItem)productsListBox.SelectedItem; 129 UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)activeItem.Tag;128 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 130 129 if (string.IsNullOrEmpty(nameTextBox.Name)) { 131 130 errorProvider.SetError(nameTextBox, "Invalid value"); … … 140 139 private void versionTextBox_TextChanged(object sender, EventArgs e) { 141 140 ListViewItem activeItem = (ListViewItem)productsListBox.SelectedItem; 142 UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)activeItem.Tag;141 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 143 142 try { 144 143 activeProduct.Version = new Version(versionTextBox.Text);
Note: See TracChangeset
for help on using the changeset viewer.