Changeset 1501 for trunk/sources/HeuristicLab.PluginInfrastructure
- Timestamp:
- 04/03/09 12:57:07 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs
r1499 r1501 199 199 200 200 //get all the plugins that have dependencies with the jobplugin 201 List<PluginInfo> depPlugins = GetDependentPlugins (jobPlugin);201 List<PluginInfo> depPlugins = GetDependentPluginsRec(jobPlugin); 202 202 //insert all jobs into one list 203 203 depPlugins.Add(jobPlugin); … … 241 241 public List<PluginInfo> GetDependentPlugins(PluginInfo pluginInfo) { 242 242 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>(); 243 268 //Bugfix the hell out of this... 244 269 //Bugfixed the hell out of this...
Note: See TracChangeset
for help on using the changeset viewer.