Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/03/09 12:30:43 (15 years ago)
Author:
kgrading
Message:

added the recursive dependency resolvement and added the SequentialEngien Dependency to the Hive.Engine (#570)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs

    r1470 r1499  
    241241    public List<PluginInfo> GetDependentPlugins(PluginInfo pluginInfo) {
    242242      List<PluginInfo> mergedList = new List<PluginInfo>();
    243       foreach (PluginInfo plugin in InstalledPlugins) {
    244         if (plugin.Dependencies.Contains(pluginInfo)) {
    245           if (!mergedList.Contains(plugin)) {
    246             mergedList.Add(plugin);
    247           }
    248           // for each of the dependent plugins add the list of transitively dependent plugins
    249           // make sure that only one entry for each plugin is added to the merged list
    250           GetDependentPlugins(plugin).ForEach(delegate(PluginInfo dependentPlugin) {
    251             if (!mergedList.Contains(dependentPlugin)) {
    252               mergedList.Add(dependentPlugin);
    253             }
    254           });
    255         }
     243      //Bugfix the hell out of this...
     244      //Bugfixed the hell out of this...
     245      foreach (PluginInfo info in pluginInfo.Dependencies) {
     246        if (!mergedList.Contains(info)) {
     247          mergedList.Add(info);
     248          AddDependenciesRecursive(info, mergedList);       
     249        }       
    256250      }
    257251      return mergedList;
     252    }
     253
     254    private void AddDependenciesRecursive(PluginInfo info, List<PluginInfo> mergedList) {
     255      //if we've already processed this element => STOP IT!
     256      if(!mergedList.Contains(info)) {
     257        mergedList.Add(info);
     258        return;
     259      }
     260      foreach (PluginInfo depinfo in info.Dependencies)
     261        AddDependenciesRecursive(depinfo, mergedList);       
    258262    }
    259263
Note: See TracChangeset for help on using the changeset viewer.