- Timestamp:
- 04/03/09 12:30:43 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs
r1470 r1499 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 } 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 } 256 250 } 257 251 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); 258 262 } 259 263
Note: See TracChangeset
for help on using the changeset viewer.