Changeset 1501


Ignore:
Timestamp:
04/03/09 12:57:07 (12 years ago)
Author:
kgrading
Message:

just noticed i've ruined gkronbergers GetDependendPlugins method. Restored the old method and renamed mine (#570)

File:
1 edited

Legend:

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

    r1499 r1501  
    199199
    200200      //get all the plugins that have dependencies with the jobplugin
    201       List<PluginInfo> depPlugins = GetDependentPlugins(jobPlugin);
     201      List<PluginInfo> depPlugins = GetDependentPluginsRec(jobPlugin);
    202202      //insert all jobs into one list
    203203      depPlugins.Add(jobPlugin);
     
    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        }
     256      }
     257      return mergedList;
     258    }
     259
     260
     261    /// <summary>
     262    /// Calculates a set of plugins that directly or transitively depend on the plugin given in the argument.
     263    /// </summary>
     264    /// <param name="pluginInfo">The plugin the other depend on.</param>
     265    /// <returns>a list of plugins that are directly of transitively dependent.</returns>
     266    public List<PluginInfo> GetDependentPluginsRec(PluginInfo pluginInfo) {
     267      List<PluginInfo> mergedList = new List<PluginInfo>();
    243268      //Bugfix the hell out of this...
    244269      //Bugfixed the hell out of this...
Note: See TracChangeset for help on using the changeset viewer.