- Timestamp:
- 04/30/09 12:59:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.2/PersistenceManager.cs
r1529 r1714 124 124 XmlNode rootNode = document.CreateElement("Root"); 125 125 document.AppendChild(rootNode); 126 XmlNode necessaryPluginsNode = document.CreateElement("NecessaryPlugins");127 rootNode.AppendChild(necessaryPluginsNode);128 126 rootNode.AppendChild(Persist(instance, document, dictionary)); 129 // determine the list of necessary plugins for this document130 DiscoveryService service = new DiscoveryService();131 List<PluginInfo> plugins = new List<PluginInfo>();132 foreach(IStorable storeable in dictionary.Values) {133 PluginInfo pluginInfo = service.GetDeclaringPlugin(storeable.GetType());134 if(!plugins.Contains(pluginInfo)) plugins.Add(pluginInfo);135 }136 foreach(PluginInfo uniquePlugin in plugins) {137 XmlNode necessaryPluginNode = document.CreateElement("Plugin");138 XmlAttribute nameAttr = document.CreateAttribute("Name");139 nameAttr.Value = uniquePlugin.Name;140 XmlAttribute versionAttr = document.CreateAttribute("Version");141 versionAttr.Value = uniquePlugin.Version.ToString();142 necessaryPluginNode.Attributes.Append(nameAttr);143 necessaryPluginNode.Attributes.Append(versionAttr);144 necessaryPluginsNode.AppendChild(necessaryPluginNode);145 }146 127 document.Save(stream); 147 128 }
Note: See TracChangeset
for help on using the changeset viewer.