Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/05/10 11:37:57 (14 years ago)
Author:
gkronber
Message:

Refactored class names and fixed a dependency-selection bug. #994 (Clean up plugin infrastructure project)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/EditProductsView.cs

    r3624 r3627  
    3232
    3333namespace HeuristicLab.PluginInfrastructure.Advanced {
    34   internal partial class ProductEditor : InstallationManagerControl {
     34  internal partial class EditProductsView : InstallationManagerControl {
    3535    private const string RefreshMessage = "Downloading product and plugin information...";
    3636    private const string UploadMessage = "Uploading product and plugin information...";
     
    4545    private HashSet<DeploymentService.ProductDescription> dirtyProducts;
    4646
    47     public ProductEditor() {
     47    public EditProductsView() {
    4848      InitializeComponent();
    4949
     
    384384          if (!modifiedPlugins.Contains(plugin))
    385385            modifiedPlugins.Add(plugin);
    386           foreach (var dep in GetAllDependencies(plugin)) {
     386          foreach (var dep in Util.GetAllDependencies(plugin)) {
    387387            if (!modifiedPlugins.Contains(dep))
    388388              modifiedPlugins.Add(dep);
     
    397397          if (!modifiedPlugins.Contains(plugin))
    398398            modifiedPlugins.Add(plugin);
    399           foreach (var dep in GetAllDependents(plugin)) {
     399          foreach (var dep in Util.GetAllDependents(plugin, plugins.Cast<IPluginDescription>())) {
    400400            if (!modifiedPlugins.Contains(dep))
    401401              modifiedPlugins.Add(dep);
     
    412412
    413413    #region helper
    414     private IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin) {
    415       return from p in plugins
    416              let matchingEntries = from dep in GetAllDependencies(p)
    417                                    where dep.Name == plugin.Name
    418                                    where dep.Version == plugin.Version
    419                                    select dep
    420              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     }
    439414    private void MarkProductDirty(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription activeProduct) {
    440415      if (!dirtyProducts.Contains(activeProduct)) {
Note: See TracChangeset for help on using the changeset viewer.