- Timestamp:
- 03/12/10 14:58:26 (15 years ago)
- Location:
- branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ConnectionSetupView.cs
r3006 r3015 12 12 public ConnectionSetupView() { 13 13 InitializeComponent(); 14 14 Caption = "Edit Connection Settings"; 15 15 updateAddressTextBox.Text = HeuristicLab.PluginInfrastructure.Properties.Settings.Default.UpdateLocation; 16 16 adminAddressTextBox.Text = HeuristicLab.PluginInfrastructure.Properties.Settings.Default.UpdateLocationAdministrationAddress; -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/HeuristicLab.DeploymentService.AdminClient.csproj
r3006 r3015 80 80 <DependentUpon>ConnectionSetupView.cs</DependentUpon> 81 81 </Compile> 82 <Compile Include="EditConnectionAction.cs" /> 83 <Compile Include="EditConnectionMenuItem.cs" /> 82 84 <Compile Include="LicenseView.cs"> 83 85 <SubType>UserControl</SubType> -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/PluginListView.Designer.cs
r3006 r3015 30 30 this.serverVersion = new System.Windows.Forms.ColumnHeader(); 31 31 this.imageList = new System.Windows.Forms.ImageList(this.components); 32 this.connectionSetupButton = new System.Windows.Forms.Button();33 32 this.refreshButton = new System.Windows.Forms.Button(); 34 33 this.uploadButton = new System.Windows.Forms.Button(); … … 81 80 this.imageList.TransparentColor = System.Drawing.Color.Transparent; 82 81 // 83 // connectionSetupButton84 //85 this.connectionSetupButton.Location = new System.Drawing.Point(84, 3);86 this.connectionSetupButton.Name = "connectionSetupButton";87 this.connectionSetupButton.Size = new System.Drawing.Size(118, 23);88 this.connectionSetupButton.TabIndex = 3;89 this.connectionSetupButton.Text = "Edit Connection...";90 this.connectionSetupButton.UseVisualStyleBackColor = true;91 this.connectionSetupButton.Click += new System.EventHandler(this.connectButton_Click);92 //93 82 // refreshButton 94 83 // … … 118 107 this.Controls.Add(this.uploadButton); 119 108 this.Controls.Add(this.refreshButton); 120 this.Controls.Add(this.connectionSetupButton);121 109 this.Controls.Add(this.listView); 122 110 this.Name = "PluginListView"; … … 131 119 private System.Windows.Forms.ColumnHeader nameHeader; 132 120 private System.Windows.Forms.ColumnHeader localVersion; 133 private System.Windows.Forms.Button connectionSetupButton;134 121 private System.Windows.Forms.ColumnHeader serverVersion; 135 122 private System.Windows.Forms.Button refreshButton; -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/PluginListView.cs
r3006 r3015 244 244 245 245 private void UpdateControlsDisconnectedState() { 246 connectionSetupButton.Text = "Connect";247 246 refreshButton.Enabled = false; 248 247 … … 255 254 256 255 private void UpdateControlsConnectedState() { 257 connectionSetupButton.Text = "Disconnect";258 connectionSetupButton.Enabled = true;259 256 refreshButton.Enabled = true; 260 257 listView.Enabled = true; … … 262 259 MainFormManager.GetMainForm<MainForm>().HideProgressBar(); 263 260 } 264 265 266 261 #endregion 267 262 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.Designer.cs
r2804 r3015 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 this.productsListBox = new System.Windows.Forms.ListBox();28 this.pluginsList = new System.Windows.Forms.CheckedListBox();29 27 this.refreshButton = new System.Windows.Forms.Button(); 30 28 this.saveButton = new System.Windows.Forms.Button(); … … 37 35 this.nameLabel = new System.Windows.Forms.Label(); 38 36 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 37 this.productsListView = new System.Windows.Forms.ListView(); 38 this.productNameHeader = new System.Windows.Forms.ColumnHeader(); 39 this.productVersionHeader = new System.Windows.Forms.ColumnHeader(); 40 this.productImageList = new System.Windows.Forms.ImageList(this.components); 41 this.pluginImageList = new System.Windows.Forms.ImageList(this.components); 42 this.pluginsListView = new System.Windows.Forms.ListView(); 43 this.pluginNameHeader = new System.Windows.Forms.ColumnHeader(); 44 this.pluginVersionHeader = new System.Windows.Forms.ColumnHeader(); 39 45 this.splitContainer.Panel1.SuspendLayout(); 40 46 this.splitContainer.Panel2.SuspendLayout(); … … 42 48 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 43 49 this.SuspendLayout(); 44 //45 // productsListBox46 //47 this.productsListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)48 | System.Windows.Forms.AnchorStyles.Left)49 | System.Windows.Forms.AnchorStyles.Right)));50 this.productsListBox.FormattingEnabled = true;51 this.productsListBox.Location = new System.Drawing.Point(3, 3);52 this.productsListBox.Name = "productsListBox";53 this.productsListBox.Size = new System.Drawing.Size(173, 355);54 this.productsListBox.TabIndex = 0;55 this.productsListBox.SelectedIndexChanged += new System.EventHandler(this.productsListBox_SelectedIndexChanged);56 //57 // pluginsList58 //59 this.pluginsList.FormattingEnabled = true;60 this.pluginsList.Location = new System.Drawing.Point(6, 85);61 this.pluginsList.Name = "pluginsList";62 this.pluginsList.Size = new System.Drawing.Size(347, 289);63 this.pluginsList.TabIndex = 1;64 50 // 65 51 // refreshButton … … 79 65 this.saveButton.Size = new System.Drawing.Size(96, 23); 80 66 this.saveButton.TabIndex = 2; 81 this.saveButton.Text = " Save changes";67 this.saveButton.Text = "Upload Products"; 82 68 this.saveButton.UseVisualStyleBackColor = true; 83 69 this.saveButton.Click += new System.EventHandler(this.saveButton_Click); … … 104 90 // splitContainer.Panel1 105 91 // 106 this.splitContainer.Panel1.Controls.Add(this.productsList Box);92 this.splitContainer.Panel1.Controls.Add(this.productsListView); 107 93 this.splitContainer.Panel1.Controls.Add(this.newProductButton); 108 94 // 109 95 // splitContainer.Panel2 110 96 // 97 this.splitContainer.Panel2.Controls.Add(this.pluginsListView); 111 98 this.splitContainer.Panel2.Controls.Add(this.pluginsLabel); 112 99 this.splitContainer.Panel2.Controls.Add(this.versionTextBox); … … 114 101 this.splitContainer.Panel2.Controls.Add(this.nameTextBox); 115 102 this.splitContainer.Panel2.Controls.Add(this.nameLabel); 116 this.splitContainer.Panel2.Controls.Add(this.pluginsList); 117 this.splitContainer.Size = new System.Drawing.Size(539, 391); 118 this.splitContainer.SplitterDistance = 179; 103 this.splitContainer.Size = new System.Drawing.Size(659, 391); 104 this.splitContainer.SplitterDistance = 319; 119 105 this.splitContainer.TabIndex = 4; 120 106 // … … 122 108 // 123 109 this.pluginsLabel.AutoSize = true; 124 this.pluginsLabel.Location = new System.Drawing.Point( 4, 69);110 this.pluginsLabel.Location = new System.Drawing.Point(11, 69); 125 111 this.pluginsLabel.Name = "pluginsLabel"; 126 112 this.pluginsLabel.Size = new System.Drawing.Size(44, 13); … … 130 116 // versionTextBox 131 117 // 132 this.versionTextBox.Location = new System.Drawing.Point(47, 29); 118 this.versionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 119 | System.Windows.Forms.AnchorStyles.Right))); 120 this.versionTextBox.Location = new System.Drawing.Point(68, 29); 133 121 this.versionTextBox.Name = "versionTextBox"; 134 this.versionTextBox.Size = new System.Drawing.Size( 100, 20);122 this.versionTextBox.Size = new System.Drawing.Size(233, 20); 135 123 this.versionTextBox.TabIndex = 5; 136 124 this.versionTextBox.TextChanged += new System.EventHandler(this.versionTextBox_TextChanged); … … 139 127 // 140 128 this.versionLabel.AutoSize = true; 141 this.versionLabel.Location = new System.Drawing.Point( 3, 32);129 this.versionLabel.Location = new System.Drawing.Point(10, 32); 142 130 this.versionLabel.Name = "versionLabel"; 143 131 this.versionLabel.Size = new System.Drawing.Size(45, 13); … … 147 135 // nameTextBox 148 136 // 149 this.nameTextBox.Location = new System.Drawing.Point(47, 3); 137 this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 138 | System.Windows.Forms.AnchorStyles.Right))); 139 this.nameTextBox.Location = new System.Drawing.Point(68, 3); 150 140 this.nameTextBox.Name = "nameTextBox"; 151 this.nameTextBox.Size = new System.Drawing.Size( 100, 20);141 this.nameTextBox.Size = new System.Drawing.Size(233, 20); 152 142 this.nameTextBox.TabIndex = 3; 153 143 this.nameTextBox.TextChanged += new System.EventHandler(this.nameTextBox_TextChanged); … … 156 146 // 157 147 this.nameLabel.AutoSize = true; 158 this.nameLabel.Location = new System.Drawing.Point( 3, 6);148 this.nameLabel.Location = new System.Drawing.Point(17, 6); 159 149 this.nameLabel.Name = "nameLabel"; 160 150 this.nameLabel.Size = new System.Drawing.Size(38, 13); … … 165 155 // 166 156 this.errorProvider.ContainerControl = this; 157 // 158 // productsListView 159 // 160 this.productsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 161 | System.Windows.Forms.AnchorStyles.Left) 162 | System.Windows.Forms.AnchorStyles.Right))); 163 this.productsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 164 this.productNameHeader, 165 this.productVersionHeader}); 166 this.productsListView.FullRowSelect = true; 167 this.productsListView.Location = new System.Drawing.Point(3, 3); 168 this.productsListView.MultiSelect = false; 169 this.productsListView.Name = "productsListView"; 170 this.productsListView.Size = new System.Drawing.Size(313, 356); 171 this.productsListView.SmallImageList = this.productImageList; 172 this.productsListView.TabIndex = 4; 173 this.productsListView.UseCompatibleStateImageBehavior = false; 174 this.productsListView.View = System.Windows.Forms.View.Details; 175 this.productsListView.SelectedIndexChanged += new System.EventHandler(this.productsListBox_SelectedIndexChanged); 176 // 177 // productNameHeader 178 // 179 this.productNameHeader.Text = "Name"; 180 this.productNameHeader.Width = 150; 181 // 182 // productVersionHeader 183 // 184 this.productVersionHeader.Text = "Version"; 185 this.productVersionHeader.Width = 100; 186 // 187 // productImageList 188 // 189 this.productImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 190 this.productImageList.ImageSize = new System.Drawing.Size(16, 16); 191 this.productImageList.TransparentColor = System.Drawing.Color.Transparent; 192 // 193 // pluginImageList 194 // 195 this.pluginImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 196 this.pluginImageList.ImageSize = new System.Drawing.Size(16, 16); 197 this.pluginImageList.TransparentColor = System.Drawing.Color.Transparent; 198 // 199 // pluginsListView 200 // 201 this.pluginsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 202 | System.Windows.Forms.AnchorStyles.Left) 203 | System.Windows.Forms.AnchorStyles.Right))); 204 this.pluginsListView.CheckBoxes = true; 205 this.pluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 206 this.pluginNameHeader, 207 this.pluginVersionHeader}); 208 this.pluginsListView.Location = new System.Drawing.Point(3, 85); 209 this.pluginsListView.Name = "pluginsListView"; 210 this.pluginsListView.Size = new System.Drawing.Size(333, 303); 211 this.pluginsListView.SmallImageList = this.pluginImageList; 212 this.pluginsListView.TabIndex = 7; 213 this.pluginsListView.UseCompatibleStateImageBehavior = false; 214 this.pluginsListView.View = System.Windows.Forms.View.Details; 215 this.pluginsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.pluginsListView_ItemChecked); 216 // 217 // pluginNameHeader 218 // 219 this.pluginNameHeader.Text = "Name"; 220 this.pluginNameHeader.Width = 220; 221 // 222 // pluginVersionHeader 223 // 224 this.pluginVersionHeader.Text = "Version"; 225 this.pluginVersionHeader.Width = 120; 167 226 // 168 227 // ProductEditor … … 174 233 this.Controls.Add(this.refreshButton); 175 234 this.Name = "ProductEditor"; 176 this.Size = new System.Drawing.Size( 545, 426);235 this.Size = new System.Drawing.Size(665, 426); 177 236 this.splitContainer.Panel1.ResumeLayout(false); 178 237 this.splitContainer.Panel2.ResumeLayout(false); … … 186 245 #endregion 187 246 188 private System.Windows.Forms.ListBox productsListBox;189 private System.Windows.Forms.CheckedListBox pluginsList;190 247 private System.Windows.Forms.Button refreshButton; 191 248 private System.Windows.Forms.Button saveButton; … … 198 255 private System.Windows.Forms.Label nameLabel; 199 256 private System.Windows.Forms.ErrorProvider errorProvider; 257 private System.Windows.Forms.ListView productsListView; 258 private System.Windows.Forms.ColumnHeader productNameHeader; 259 private System.Windows.Forms.ColumnHeader productVersionHeader; 260 private System.Windows.Forms.ImageList productImageList; 261 private System.Windows.Forms.ImageList pluginImageList; 262 private System.Windows.Forms.ListView pluginsListView; 263 private System.Windows.Forms.ColumnHeader pluginNameHeader; 264 private System.Windows.Forms.ColumnHeader pluginVersionHeader; 200 265 201 266 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.cs
r2816 r3015 9 9 using HeuristicLab.MainForm; 10 10 using PluginDeploymentService = HeuristicLab.PluginInfrastructure.Advanced.DeploymentService; 11 using System.ServiceModel; 12 using HeuristicLab.PluginInfrastructure; 11 13 12 14 namespace HeuristicLab.DeploymentService.AdminClient { … … 22 24 Caption = "Products"; 23 25 26 productImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.Assembly); 27 productImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowUp); 28 pluginImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.Assembly); 29 24 30 dirtyProducts = new HashSet<PluginDeploymentService.ProductDescription>(); 25 31 refreshProductsWorker = new BackgroundWorker(); … … 32 38 } 33 39 34 void uploadChangedProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 40 #region event handlers for upload products background worker 41 private void uploadChangedProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 35 42 var products = (IEnumerable<PluginDeploymentService.ProductDescription>)e.Argument; 36 using (var adminClient = new PluginDeploymentService.AdminClient()) { 43 var adminClient = PluginDeploymentService.AdminClientFactory.CreateClient(); 44 try { 37 45 foreach (var product in products) { 38 46 adminClient.DeployProduct(product); 39 47 } 40 } 41 e.Cancel = false; 42 } 43 44 void uploadChangedProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 48 e.Cancel = false; 49 } 50 catch (FaultException) { 51 } 52 } 53 54 private void uploadChangedProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 45 55 this.Enabled = true; 46 } 47 48 void refreshProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 49 var updateClient = new PluginDeploymentService.UpdateClient(); 50 e.Result = new object[] { updateClient.GetProducts(), updateClient.GetPlugins() }; 51 } 52 53 void refreshProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 56 refreshProductsWorker.RunWorkerAsync(); 57 } 58 #endregion 59 60 #region event handlers for refresh products background worker 61 private void refreshProductsWorker_DoWork(object sender, DoWorkEventArgs e) { 62 var updateClient = PluginDeploymentService.UpdateClientFactory.CreateClient(); 63 try { 64 e.Result = new object[] { updateClient.GetProducts(), updateClient.GetPlugins() }; 65 } 66 catch (FaultException) { 67 e.Cancel = true; 68 } 69 } 70 71 private void refreshProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { 54 72 this.products = new List<PluginDeploymentService.ProductDescription>( 55 73 (PluginDeploymentService.ProductDescription[])((object[])e.Result)[0]); … … 63 81 SetControlsEnabled(true); 64 82 } 83 #endregion 65 84 66 85 private void UpdateProductsList() { 86 productsListView.Items.Clear(); 67 87 foreach (var prodDesc in products) { 68 productsList Box.Items.Add(CreateListViewItem(prodDesc));88 productsListView.Items.Add(CreateListViewItem(prodDesc)); 69 89 } 70 90 } 71 91 72 92 private void productsListBox_SelectedIndexChanged(object sender, EventArgs e) { 73 if (productsList Box.SelectedItems.Count == 0) return;74 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)((ListViewItem)productsList Box.SelectedItem).Tag;93 if (productsListView.SelectedItems.Count == 0) return; 94 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)((ListViewItem)productsListView.SelectedItems[0]).Tag; 75 95 UpdateProductDetails(activeProduct); 76 96 } … … 80 100 versionTextBox.Text = activeProduct.Version.ToString(); 81 101 82 pluginsList .Items.Clear();102 pluginsListView.Items.Clear(); 83 103 foreach (PluginDeploymentService.PluginDescription pluginDesc in plugins) { 84 104 var matching = from p in activeProduct.Plugins … … 87 107 select p; 88 108 89 if (matching.Any()) pluginsList.Items.Add(pluginDesc, true); 90 else pluginsList.Items.Add(pluginDesc, false); 91 } 109 if (matching.Any()) pluginsListView.Items.Add(CreateCheckedListViewItem(pluginDesc)); 110 else pluginsListView.Items.Add(CreateUncheckedListViewItem(pluginDesc)); 111 } 112 } 113 114 private ListViewItem CreateUncheckedListViewItem(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.PluginDescription pluginDesc) { 115 ListViewItem item = new ListViewItem(new string[] { pluginDesc.Name, pluginDesc.Version.ToString() }); 116 item.Checked = false; 117 item.Tag = pluginDesc; 118 item.ImageIndex = 0; 119 return item; 120 } 121 122 private ListViewItem CreateCheckedListViewItem(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.PluginDescription pluginDesc) { 123 ListViewItem item = new ListViewItem(new string[] { pluginDesc.Name, pluginDesc.Version.ToString() }); 124 item.Checked = true; 125 item.Tag = pluginDesc; 126 item.ImageIndex = 0; 127 return item; 128 } 129 130 private ListViewItem CreateListViewItem(PluginDeploymentService.ProductDescription productDescription) { 131 ListViewItem item = new ListViewItem(new string[] { productDescription.Name, productDescription.Version.ToString() }); 132 item.Tag = productDescription; 133 item.ImageIndex = 0; 134 return item; 92 135 } 93 136 … … 107 150 var newProduct = new PluginDeploymentService.ProductDescription("New product", new Version("0.0.0.0")); 108 151 ListViewItem item = CreateListViewItem(newProduct); 109 productsListBox.Items.Add(item); 110 dirtyProducts.Add(newProduct); 111 } 112 113 private ListViewItem CreateListViewItem(PluginDeploymentService.ProductDescription productDescription) { 114 ListViewItem item = new ListViewItem(); 115 item.Text = productDescription.Name + " " + productDescription.Version; 116 item.Name = productDescription.Name + " " + productDescription.Version; 117 item.Tag = productDescription; 118 return item; 152 productsListView.Items.Add(item); 153 MarkProductDirty(newProduct); 119 154 } 120 155 … … 125 160 126 161 private void nameTextBox_TextChanged(object sender, EventArgs e) { 127 ListViewItem activeItem = (ListViewItem)productsList Box.SelectedItem;162 ListViewItem activeItem = (ListViewItem)productsListView.SelectedItems[0]; 128 163 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 129 164 if (string.IsNullOrEmpty(nameTextBox.Name)) { 130 165 errorProvider.SetError(nameTextBox, "Invalid value"); 131 166 } else { 132 activeProduct.Name = nameTextBox.Text; 133 activeItem.Text = activeProduct.Name + " " + activeProduct.Version; 134 activeItem.Name = activeProduct.Name + " " + activeProduct.Version; 135 errorProvider.SetError(nameTextBox, string.Empty); 136 } 137 } 167 if (activeProduct.Name != nameTextBox.Text) { 168 activeProduct.Name = nameTextBox.Text; 169 activeItem.SubItems[0].Text = activeProduct.Name; 170 errorProvider.SetError(nameTextBox, string.Empty); 171 MarkProductDirty(activeProduct); 172 } 173 } 174 } 175 138 176 139 177 private void versionTextBox_TextChanged(object sender, EventArgs e) { 140 ListViewItem activeItem = (ListViewItem)productsList Box.SelectedItem;178 ListViewItem activeItem = (ListViewItem)productsListView.SelectedItems[0]; 141 179 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 142 180 try { 143 activeProduct.Version = new Version(versionTextBox.Text); 144 activeItem.Text = activeProduct.Name + " " + activeProduct.Version; 145 activeItem.Name = activeProduct.Name + " " + activeProduct.Version; 146 errorProvider.SetError(versionTextBox, string.Empty); 181 var newVersion = new Version(versionTextBox.Text); 182 if (activeProduct.Version != newVersion) { 183 activeProduct.Version = newVersion; 184 activeItem.SubItems[1].Text = versionTextBox.Text; 185 errorProvider.SetError(versionTextBox, string.Empty); 186 MarkProductDirty(activeProduct); 187 } 147 188 } 148 189 catch (OverflowException ex) { … … 157 198 } 158 199 } 200 201 private void pluginsListView_ItemChecked(object sender, ItemCheckedEventArgs e) { 202 var pluginItem = e.Item; 203 var activePlugin = (IPluginDescription)pluginItem.Tag; 204 ListViewItem activeItem = (ListViewItem)productsListView.SelectedItems[0]; 205 PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag; 206 if (pluginItem.Checked && !activeProduct.Plugins.Contains(activePlugin)) { 207 activeProduct.AddPlugin(activePlugin); 208 MarkProductDirty(activeProduct); 209 } else if (!pluginItem.Checked && activeProduct.Plugins.Contains(activePlugin)) { 210 activeProduct.RemovePlugin(activePlugin); 211 MarkProductDirty(activeProduct); 212 } 213 } 214 215 private void MarkProductDirty(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription activeProduct) { 216 if (!dirtyProducts.Contains(activeProduct)) { 217 dirtyProducts.Add(activeProduct); 218 var item = FindItemForProduct(activeProduct); 219 item.ImageIndex = 1; 220 } 221 } 222 223 private ListViewItem FindItemForProduct(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription activeProduct) { 224 return (from item in productsListView.Items.OfType<ListViewItem>() 225 let product = item.Tag as PluginDeploymentService.ProductDescription 226 where product != null 227 where product == activeProduct 228 select item).Single(); 229 } 159 230 } 160 231 } -
branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.resx
r2802 r3015 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="productImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>140, 17</value> 122 </metadata> 123 <metadata name="pluginImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 124 <value>287, 17</value> 125 </metadata> 120 126 <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 127 <value>17, 17</value>
Note: See TracChangeset
for help on using the changeset viewer.