Changeset 3627 for trunk/sources/HeuristicLab.PluginInfrastructure
- Timestamp:
- 05/05/10 11:37:57 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/Advanced
- Files:
-
- 6 deleted
- 7 edited
- 15 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/AvailablePluginsView.Designer.cs
r3624 r3627 20 20 #endregion 21 21 namespace HeuristicLab.PluginInfrastructure.Advanced { 22 partial class RemotePluginInstallerView {22 partial class AvailablePluginsView { 23 23 /// <summary> 24 24 /// Required designer variable. -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/AvailablePluginsView.cs
r3624 r3627 30 30 31 31 namespace HeuristicLab.PluginInfrastructure.Advanced { 32 internal partial class RemotePluginInstallerView : InstallationManagerControl {32 internal partial class AvailablePluginsView : InstallationManagerControl { 33 33 private class RefreshBackgroundWorkerResult { 34 34 public IEnumerable<IPluginDescription> RemotePlugins { get; set; } … … 66 66 set { pluginManager = value; } 67 67 } 68 public RemotePluginInstallerView() {68 public AvailablePluginsView() { 69 69 InitializeComponent(); 70 70 productImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Setup_Install); … … 212 212 213 213 private void UpdatePluginsList() { 214 // clear plugins list view 215 List<ListViewItem> pluginItemsToDelete = new List<ListViewItem>(pluginsListView.Items.OfType<ListViewItem>()); 216 pluginItemsToDelete.ForEach(item => pluginsListView.Items.Remove(item)); 214 pluginsListView.Items.Clear(); 217 215 218 216 // populate plugins list … … 264 262 private void remotePluginsListView_ItemChecked(object sender, ItemCheckedEventArgs e) { 265 263 foreach (ListViewItem item in pluginsListView.SelectedItems) { 266 // dispatch by check state and type of item (product/plugin) 267 IPluginDescription plugin = item.Tag as IPluginDescription; 268 if (plugin != null) 269 if (e.Item.Checked) 270 HandlePluginChecked(plugin); 271 else 272 HandlePluginUnchecked(plugin); 273 else { 274 DeploymentService.ProductDescription product = item.Tag as DeploymentService.ProductDescription; 275 if (product != null) 276 if (e.Item.Checked) 277 HandleProductChecked(product); 278 else 279 HandleProductUnchecked(product); 280 } 264 IPluginDescription plugin = (IPluginDescription)item.Tag; 265 if (e.Item.Checked) 266 HandlePluginChecked(plugin); 267 else 268 HandlePluginUnchecked(plugin); 281 269 } 282 270 installPluginsButton.Enabled = pluginsListView.CheckedItems.Count > 0; 283 }284 285 private void HandleProductUnchecked(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription product) {286 // also uncheck the plugins of the product287 List<ListViewItem> modifiedItems = new List<ListViewItem>();288 modifiedItems.Add(FindItemForProduct(product));289 foreach (var plugin in product.Plugins) {290 // there can be multiple entries for a single plugin in different groups291 foreach (var item in FindItemsForPlugin(plugin)) {292 if (item != null && item.Checked)293 modifiedItems.Add(item);294 }295 }296 pluginsListView.UncheckItems(modifiedItems);297 }298 299 private void HandleProductChecked(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription product) {300 // also check all plugins of the product301 List<ListViewItem> modifiedItems = new List<ListViewItem>();302 modifiedItems.Add(FindItemForProduct(product));303 foreach (var plugin in product.Plugins) {304 // there can be multiple entries for a single plugin in different groups305 foreach (var item in FindItemsForPlugin(plugin)) {306 if (item != null && !item.Checked) {307 if (!modifiedItems.Contains(item))308 modifiedItems.Add(item);309 }310 }311 }312 pluginsListView.CheckItems(modifiedItems);313 271 } 314 272 … … 317 275 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 318 276 modifiedItems.AddRange(FindItemsForPlugin(plugin)); 319 var dependentPlugins = from otherPlugin in plugins 320 where otherPlugin.Dependencies.Any(dep => dep.Name == plugin.Name && dep.Version == plugin.Version) 321 select otherPlugin; 277 var dependentPlugins = Util.GetAllDependents(plugin, plugins); 322 278 foreach (var dependentPlugin in dependentPlugins) { 323 279 // there can be multiple entries for a single plugin in different groups … … 329 285 } 330 286 } 331 // also uncheck all products containing this plugin332 var dependentProducts = from product in products333 where product.Plugins.Any(p => p.Name == plugin.Name && p.Version == plugin.Version)334 select product;335 foreach (var dependentProduct in dependentProducts) {336 var item = FindItemForProduct(dependentProduct);337 if (item != null && item.Checked) {338 if (!modifiedItems.Contains(item))339 modifiedItems.Add(item);340 }341 }342 287 pluginsListView.UncheckItems(modifiedItems); 343 288 } … … 347 292 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 348 293 modifiedItems.AddRange(FindItemsForPlugin(plugin)); 349 foreach (var dep in plugin.Dependencies) {294 foreach (var dep in Util.GetAllDependencies(plugin)) { 350 295 // there can be multiple entries for a single plugin in different groups 351 296 foreach (ListViewItem item in FindItemsForPlugin(dep)) { … … 369 314 } 370 315 371 private ListViewItem FindItemForProduct(DeploymentService.ProductDescription product) {372 return (from item in pluginsListView.Items.OfType<ListViewItem>()373 let otherProduct = item.Tag as DeploymentService.ProductDescription374 where otherProduct != null && otherProduct.Name == product.Name && otherProduct.Version == product.Version375 select item).SingleOrDefault();376 }377 378 316 private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 379 317 // newer: build version is higher, or if build version is the same revision is higher -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/EditProductsView.Designer.cs
r3624 r3627 21 21 22 22 namespace HeuristicLab.PluginInfrastructure.Advanced { 23 partial class ProductEditor{23 partial class EditProductsView { 24 24 /// <summary> 25 25 /// Required designer variable. -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/EditProductsView.cs
r3624 r3627 32 32 33 33 namespace HeuristicLab.PluginInfrastructure.Advanced { 34 internal partial class ProductEditor: InstallationManagerControl {34 internal partial class EditProductsView : InstallationManagerControl { 35 35 private const string RefreshMessage = "Downloading product and plugin information..."; 36 36 private const string UploadMessage = "Uploading product and plugin information..."; … … 45 45 private HashSet<DeploymentService.ProductDescription> dirtyProducts; 46 46 47 public ProductEditor() {47 public EditProductsView() { 48 48 InitializeComponent(); 49 49 … … 384 384 if (!modifiedPlugins.Contains(plugin)) 385 385 modifiedPlugins.Add(plugin); 386 foreach (var dep in GetAllDependencies(plugin)) {386 foreach (var dep in Util.GetAllDependencies(plugin)) { 387 387 if (!modifiedPlugins.Contains(dep)) 388 388 modifiedPlugins.Add(dep); … … 397 397 if (!modifiedPlugins.Contains(plugin)) 398 398 modifiedPlugins.Add(plugin); 399 foreach (var dep in GetAllDependents(plugin)) {399 foreach (var dep in Util.GetAllDependents(plugin, plugins.Cast<IPluginDescription>())) { 400 400 if (!modifiedPlugins.Contains(dep)) 401 401 modifiedPlugins.Add(dep); … … 412 412 413 413 #region helper 414 private IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin) {415 return from p in plugins416 let matchingEntries = from dep in GetAllDependencies(p)417 where dep.Name == plugin.Name418 where dep.Version == plugin.Version419 select dep420 where matchingEntries.Any()421 select p as IPluginDescription;422 }423 424 private IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) {425 HashSet<IPluginDescription> yieldedPlugins = new HashSet<IPluginDescription>();426 foreach (var dep in plugin.Dependencies) {427 foreach (var recDep in GetAllDependencies(dep)) {428 if (!yieldedPlugins.Contains(recDep)) {429 yieldedPlugins.Add(recDep);430 yield return recDep;431 }432 }433 if (!yieldedPlugins.Contains(dep)) {434 yieldedPlugins.Add(dep);435 yield return dep;436 }437 }438 }439 414 private void MarkProductDirty(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription activeProduct) { 440 415 if (!dirtyProducts.Contains(activeProduct)) { -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.Designer.cs
r3624 r3627 53 53 this.basicUpdateView = new HeuristicLab.PluginInfrastructure.Advanced.BasicUpdateView(); 54 54 this.localPluginsTabPage = new System.Windows.Forms.TabPage(); 55 this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced. LocalPluginsView();55 this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced.InstalledPluginsView(); 56 56 this.availablePluginsTabPage = new System.Windows.Forms.TabPage(); 57 this.remotePluginInstaller = new HeuristicLab.PluginInfrastructure.Advanced. RemotePluginInstallerView();57 this.remotePluginInstaller = new HeuristicLab.PluginInfrastructure.Advanced.AvailablePluginsView(); 58 58 this.uploadPluginsTabPage = new System.Windows.Forms.TabPage(); 59 this.pluginEditor = new HeuristicLab.PluginInfrastructure.Advanced. PluginEditor();59 this.pluginEditor = new HeuristicLab.PluginInfrastructure.Advanced.UploadPluginsView(); 60 60 this.manageProductsTabPage = new System.Windows.Forms.TabPage(); 61 this.productEditor = new HeuristicLab.PluginInfrastructure.Advanced. ProductEditor();61 this.productEditor = new HeuristicLab.PluginInfrastructure.Advanced.EditProductsView(); 62 62 this.logTabPage = new System.Windows.Forms.TabPage(); 63 63 this.logTextBox = new System.Windows.Forms.TextBox(); … … 324 324 private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar; 325 325 private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; 326 private RemotePluginInstallerView remotePluginInstaller;326 private AvailablePluginsView remotePluginInstaller; 327 327 private System.Windows.Forms.TabControl tabControl; 328 328 private System.Windows.Forms.TabPage localPluginsTabPage; … … 335 335 private System.Windows.Forms.TabPage uploadPluginsTabPage; 336 336 private System.Windows.Forms.TabPage manageProductsTabPage; 337 private PluginEditorpluginEditor;338 private ProductEditorproductEditor;339 private LocalPluginsView localPluginsView;337 private UploadPluginsView pluginEditor; 338 private EditProductsView productEditor; 339 private InstalledPluginsView localPluginsView; 340 340 private System.Windows.Forms.TabPage updateAllPluginsTabPage; 341 341 private BasicUpdateView basicUpdateView; -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.cs
r3624 r3627 172 172 foreach (var plugin in plugins) { 173 173 if (!string.IsNullOrEmpty(plugin.LicenseText)) { 174 var licenseConfirmationBox = new LicenseConfirmation Box(plugin);174 var licenseConfirmationBox = new LicenseConfirmationDialog(plugin); 175 175 if (licenseConfirmationBox.ShowDialog() != DialogResult.OK) 176 176 return false; -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstalledPluginsView.Designer.cs
r3624 r3627 21 21 22 22 namespace HeuristicLab.PluginInfrastructure.Advanced { 23 partial class LocalPluginsView {23 partial class InstalledPluginsView { 24 24 /// <summary> 25 25 /// Required designer variable. -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstalledPluginsView.cs
r3624 r3627 34 34 35 35 namespace HeuristicLab.PluginInfrastructure.Advanced { 36 internal partial class LocalPluginsView : InstallationManagerControl {36 internal partial class InstalledPluginsView : InstallationManagerControl { 37 37 private const string CheckingPluginsMessage = "Checking for updated plugins..."; 38 38 private const string NoUpdatesAvailableMessage = "No updates available."; … … 58 58 } 59 59 60 public LocalPluginsView()60 public InstalledPluginsView() 61 61 : base() { 62 62 InitializeComponent(); … … 171 171 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 172 172 foreach (ListViewItem item in localPluginsListView.SelectedItems) { 173 var plugin = (IPluginDescription)item.Tag;174 173 modifiedItems.Add(item); 175 // also uncheck all dependent plugins 176 foreach (ListViewItem dependentItem in localPluginsListView.Items) { 177 var dependent = (IPluginDescription)dependentItem.Tag; 178 if (!dependentItem.Checked && (from dep in dependent.Dependencies 179 where dep.Name == plugin.Name 180 where dep.Version == plugin.Version 181 select dep).Any()) { 182 modifiedItems.Add(dependentItem); 174 int oldItemsCount = 0; 175 while (oldItemsCount < modifiedItems.Count) { 176 oldItemsCount = modifiedItems.Count; 177 var oldModifiedItems = new List<ListViewItem>(modifiedItems); 178 foreach (var modifiedItem in oldModifiedItems) { 179 var plugin = (IPluginDescription)modifiedItem.Tag; 180 // also check all dependent plugins 181 foreach (ListViewItem dependentItem in localPluginsListView.Items) { 182 var dependent = (IPluginDescription)dependentItem.Tag; 183 if (!modifiedItems.Contains(dependentItem) && 184 !dependentItem.Checked && (from dep in dependent.Dependencies 185 where dep.Name == plugin.Name 186 where dep.Version == plugin.Version 187 select dep).Any()) { 188 modifiedItems.Add(dependentItem); 189 } 190 } 183 191 } 184 192 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LicenseConfirmationDialog.Designer.cs
r3623 r3627 20 20 #endregion 21 21 namespace HeuristicLab.PluginInfrastructure.Advanced { 22 partial class LicenseConfirmation Box{22 partial class LicenseConfirmationDialog { 23 23 /// <summary> 24 24 /// Required designer variable. … … 45 45 private void InitializeComponent() { 46 46 this.components = new System.ComponentModel.Container(); 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LicenseConfirmation Box));47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LicenseConfirmationDialog)); 48 48 this.richTextBox = new System.Windows.Forms.RichTextBox(); 49 49 this.acceptButton = new System.Windows.Forms.Button(); … … 89 89 // 90 90 this.rejectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 91 this.rejectButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 91 92 this.rejectButton.Location = new System.Drawing.Point(428, 53); 92 93 this.rejectButton.Name = "rejectButton"; … … 165 166 this.panel1.TabIndex = 6; 166 167 // 167 // LicenseConfirmationBox 168 // 168 // LicenseConfirmationDialog 169 // 170 this.AcceptButton = this.acceptButton; 169 171 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 170 172 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 171 173 this.BackColor = System.Drawing.SystemColors.HighlightText; 174 this.CancelButton = this.rejectButton; 172 175 this.ClientSize = new System.Drawing.Size(518, 429); 173 176 this.Controls.Add(this.panel1); … … 176 179 this.Controls.Add(this.richTextBox); 177 180 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 178 this.Name = "LicenseConfirmationBox"; 181 this.MaximizeBox = false; 182 this.MinimizeBox = false; 183 this.Name = "LicenseConfirmationDialog"; 184 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 179 185 this.radioButtonGroupBox.ResumeLayout(false); 180 186 this.radioButtonGroupBox.PerformLayout(); -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LicenseConfirmationDialog.cs
r3623 r3627 29 29 30 30 namespace HeuristicLab.PluginInfrastructure.Advanced { 31 internal partial class LicenseConfirmation Box: Form {32 public LicenseConfirmation Box() {31 internal partial class LicenseConfirmationDialog : Form { 32 public LicenseConfirmationDialog() { 33 33 InitializeComponent(); 34 34 } 35 35 36 public LicenseConfirmation Box(IPluginDescription plugin) {36 public LicenseConfirmationDialog(IPluginDescription plugin) { 37 37 InitializeComponent(); 38 38 richTextBox.Text = plugin.LicenseText; -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LicenseView.Designer.cs
r3474 r3627 67 67 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 68 68 this.Name = "LicenseView"; 69 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 69 70 this.Text = "License Agreement"; 70 71 this.ResumeLayout(false); -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.Designer.cs
r3624 r3627 52 52 this.contactTextBox = new System.Windows.Forms.TextBox(); 53 53 this.contactInfoLabel = new System.Windows.Forms.Label(); 54 this.licenseButton = new System.Windows.Forms.Button();55 54 this.dependenciesGroupBox = new System.Windows.Forms.GroupBox(); 56 55 this.dependenciesListView = new System.Windows.Forms.ListView(); … … 70 69 this.descriptionTextBox = new System.Windows.Forms.TextBox(); 71 70 this.errorTextBox = new System.Windows.Forms.TextBox(); 71 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 72 this.showLicenseButton = new System.Windows.Forms.Button(); 72 73 this.dependenciesGroupBox.SuspendLayout(); 73 74 this.filesGroupBox.SuspendLayout(); … … 131 132 this.contactInfoLabel.Text = "Contact:"; 132 133 // 133 // licenseButton134 //135 this.licenseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));136 this.licenseButton.Location = new System.Drawing.Point(3, 575);137 this.licenseButton.Name = "licenseButton";138 this.licenseButton.Size = new System.Drawing.Size(103, 23);139 this.licenseButton.TabIndex = 10;140 this.licenseButton.Text = "Show license";141 this.licenseButton.UseVisualStyleBackColor = true;142 this.licenseButton.Click += new System.EventHandler(this.licenseButton_Click);143 //144 134 // dependenciesGroupBox 145 135 // … … 150 140 this.dependenciesGroupBox.Location = new System.Drawing.Point(12, 324); 151 141 this.dependenciesGroupBox.Name = "dependenciesGroupBox"; 152 this.dependenciesGroupBox.Size = new System.Drawing.Size(663, 229);142 this.dependenciesGroupBox.Size = new System.Drawing.Size(663, 198); 153 143 this.dependenciesGroupBox.TabIndex = 1; 154 144 this.dependenciesGroupBox.TabStop = false; … … 164 154 this.dependenciesListView.Location = new System.Drawing.Point(3, 16); 165 155 this.dependenciesListView.Name = "dependenciesListView"; 166 this.dependenciesListView.Size = new System.Drawing.Size(657, 210);156 this.dependenciesListView.Size = new System.Drawing.Size(657, 179); 167 157 this.dependenciesListView.SmallImageList = this.pluginsImageList; 168 158 this.dependenciesListView.Sorting = System.Windows.Forms.SortOrder.Ascending; … … 294 284 this.errorTextBox.TabIndex = 21; 295 285 // 286 // showLicenseButton 287 // 288 this.showLicenseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 289 this.showLicenseButton.Location = new System.Drawing.Point(12, 528); 290 this.showLicenseButton.Name = "showLicenseButton"; 291 this.showLicenseButton.Size = new System.Drawing.Size(87, 23); 292 this.showLicenseButton.TabIndex = 22; 293 this.showLicenseButton.Text = "Show License"; 294 this.toolTip.SetToolTip(this.showLicenseButton, "Show Plugin License"); 295 this.showLicenseButton.UseVisualStyleBackColor = true; 296 this.showLicenseButton.Click += new System.EventHandler(this.showLicenseButton_Click); 297 // 296 298 // PluginView 297 299 // … … 299 301 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 300 302 this.ClientSize = new System.Drawing.Size(687, 565); 303 this.Controls.Add(this.showLicenseButton); 301 304 this.Controls.Add(this.errorTextBox); 302 305 this.Controls.Add(this.descriptionTextBox); … … 307 310 this.Controls.Add(this.dependenciesGroupBox); 308 311 this.Controls.Add(this.filesGroupBox); 309 this.Controls.Add(this.licenseButton);310 312 this.Controls.Add(this.contactTextBox); 311 313 this.Controls.Add(this.contactInfoLabel); … … 331 333 protected System.Windows.Forms.TextBox contactTextBox; 332 334 protected System.Windows.Forms.Label contactInfoLabel; 333 protected System.Windows.Forms.Button licenseButton;334 335 protected System.Windows.Forms.GroupBox dependenciesGroupBox; 335 336 private System.Windows.Forms.ColumnHeader pluginNameHeader; … … 349 350 private System.Windows.Forms.ImageList filesImageList; 350 351 private System.Windows.Forms.ColumnHeader pluginDescriptionHeader; 352 private System.Windows.Forms.ToolTip toolTip; 353 private System.Windows.Forms.Button showLicenseButton; 351 354 352 355 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.cs
r3624 r3627 66 66 versionTextBox.Text = plugin.Version.ToString(); 67 67 contactTextBox.Text = CombineStrings(plugin.ContactName, plugin.ContactEmail); 68 toolTip.SetToolTip(contactTextBox, contactTextBox.Text); 68 69 descriptionTextBox.Text = plugin.Description; 70 toolTip.SetToolTip(descriptionTextBox, plugin.Description); 69 71 var localPlugin = plugin as PluginDescription; 70 72 if (localPlugin != null) { 71 73 stateTextBox.Text = localPlugin.PluginState.ToString(); 72 74 errorTextBox.Text = localPlugin.LoadingErrorInformation; 75 toolTip.SetToolTip(stateTextBox, stateTextBox.Text + Environment.NewLine + errorTextBox.Text); 76 toolTip.SetToolTip(errorTextBox, errorTextBox.Text); 73 77 } 74 78 foreach (PluginDescription dependency in plugin.Dependencies) { … … 92 96 Util.ResizeColumns(filesListView.Columns.OfType<ColumnHeader>()); 93 97 94 licenseButton.Enabled = !string.IsNullOrEmpty(plugin.LicenseText);98 showLicenseButton.Enabled = !string.IsNullOrEmpty(plugin.LicenseText); 95 99 } 96 100 … … 106 110 } 107 111 108 private void licenseButton_Click(object sender, EventArgs e) {109 LicenseView view = new LicenseView(plugin);110 view.Show();111 }112 113 112 private void dependenciesListView_ItemActivate(object sender, EventArgs e) { 114 113 if (dependenciesListView.SelectedItems.Count > 0) { … … 118 117 } 119 118 } 119 120 private void showLicenseButton_Click(object sender, EventArgs e) { 121 LicenseView view = new LicenseView(plugin); 122 view.Show(); 123 } 120 124 } 121 125 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.resx
r3573 r3627 123 123 <metadata name="filesImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 124 124 <value>181, 17</value> 125 </metadata> 126 <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 <value>306, 17</value> 125 128 </metadata> 126 129 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/UploadPluginsView.Designer.cs
r3624 r3627 21 21 22 22 namespace HeuristicLab.PluginInfrastructure.Advanced { 23 partial class PluginEditor{23 partial class UploadPluginsView { 24 24 /// <summary> 25 25 /// Required designer variable. -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/UploadPluginsView.cs
r3624 r3627 34 34 35 35 namespace HeuristicLab.PluginInfrastructure.Advanced { 36 internal partial class PluginEditor: InstallationManagerControl {36 internal partial class UploadPluginsView : InstallationManagerControl { 37 37 private const string UploadMessage = "Uploading plugins..."; 38 38 private const string RefreshMessage = "Downloading plugin information from deployment service..."; … … 48 48 } 49 49 50 public PluginEditor() {50 public UploadPluginsView() { 51 51 InitializeComponent(); 52 52 pluginImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16); … … 192 192 if (!modifiedPlugins.Contains(plugin)) 193 193 modifiedPlugins.Add(plugin); 194 foreach (var dep in GetAllDependencies(plugin)) {194 foreach (var dep in Util.GetAllDependencies(plugin)) { 195 195 if (!modifiedPlugins.Contains(dep)) 196 196 modifiedPlugins.Add(dep); … … 204 204 if (!modifiedPlugins.Contains(plugin)) 205 205 modifiedPlugins.Add(plugin); 206 foreach (var dep in GetAllDependents(plugin)) {206 foreach (var dep in Util.GetAllDependents(plugin, localAndServerPlugins.Keys)) { 207 207 if (!modifiedPlugins.Contains(dep)) 208 208 modifiedPlugins.Add(dep); … … 242 242 Util.ResizeColumns(listView.Columns.OfType<ColumnHeader>()); 243 243 ignoreItemCheckedEvents = false; 244 }245 246 private IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin) {247 return from p in localAndServerPlugins.Keys248 let matchingEntries = from dep in GetAllDependencies(p)249 where dep.Name == plugin.Name250 where dep.Version == plugin.Version251 select dep252 where matchingEntries.Any()253 select p;254 }255 256 private IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) {257 foreach (var dep in plugin.Dependencies) {258 foreach (var recDep in GetAllDependencies(dep)) {259 yield return recDep;260 }261 yield return dep;262 }263 244 } 264 245 -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/Util.cs
r3624 r3627 46 46 ResizeColumn(columnHeader); 47 47 } 48 49 internal static IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin, IEnumerable<IPluginDescription> availablePlugins) { 50 return from p in availablePlugins 51 let matchingEntries = from dep in GetAllDependencies(p) 52 where dep.Name == plugin.Name 53 where dep.Version == plugin.Version 54 select dep 55 where matchingEntries.Any() 56 select p as IPluginDescription; 57 } 58 59 internal static IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) { 60 HashSet<IPluginDescription> yieldedPlugins = new HashSet<IPluginDescription>(); 61 foreach (var dep in plugin.Dependencies) { 62 foreach (var recDep in GetAllDependencies(dep)) { 63 if (!yieldedPlugins.Contains(recDep)) { 64 yieldedPlugins.Add(recDep); 65 yield return recDep; 66 } 67 } 68 if (!yieldedPlugins.Contains(dep)) { 69 yieldedPlugins.Add(dep); 70 yield return dep; 71 } 72 } 73 } 74 48 75 } 49 76 }
Note: See TracChangeset
for help on using the changeset viewer.