Changeset 1730 for trunk/sources/HeuristicLab.PluginInfrastructure
- Timestamp:
- 05/02/09 22:43:01 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs
r1715 r1730 263 263 } 264 264 265 266 /// <summary>267 /// Calculates a set of plugins that directly or transitively depend on the plugin given in the argument.268 /// </summary>269 /// <param name="pluginInfo">The plugin the other depend on.</param>270 /// <returns>a list of plugins that are directly of transitively dependent.</returns>271 public List<PluginInfo> GetDependentPluginsRec(PluginInfo pluginInfo) {272 List<PluginInfo> mergedList = new List<PluginInfo>();273 //Bugfix the hell out of this...274 //Bugfixed the hell out of this...275 foreach (PluginInfo info in pluginInfo.Dependencies) {276 if (!mergedList.Contains(info)) {277 mergedList.Add(info);278 AddDependenciesRecursive(info, mergedList);279 }280 }281 return mergedList;282 }283 284 private void AddDependenciesRecursive(PluginInfo info, List<PluginInfo> mergedList) {285 //if we've already processed this element => STOP IT!286 if(!mergedList.Contains(info)) {287 mergedList.Add(info);288 return;289 }290 foreach (PluginInfo depinfo in info.Dependencies)291 AddDependenciesRecursive(depinfo, mergedList);292 }293 294 265 /// <summary> 295 266 /// Unloads all plugins.
Note: See TracChangeset
for help on using the changeset viewer.