Changeset 57
- Timestamp:
- 03/10/08 00:33:22 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Modularization/HeuristicLab.Core/Scope.cs
r56 r57 136 136 } 137 137 public void AddAlias(string alias, string name) { 138 RemoveAlias(alias); 138 139 if (alias != name) { 139 if (myAliases.ContainsKey(alias))140 myAliases.Remove(alias);141 140 myAliases.Add(alias, name); 142 141 OnAliasAdded(alias); … … 277 276 XmlNode aliases = document.CreateNode(XmlNodeType.Element, "Aliases", null); 278 277 foreach (KeyValuePair<string, string> alias in myAliases) { 279 XmlNode child = document.CreateNode(XmlNodeType.Element, alias.Key, null); 280 child.InnerText = alias.Value; 281 aliases.AppendChild(child); 278 XmlNode aliasNode = document.CreateNode(XmlNodeType.Element, "Alias", null); 279 XmlAttribute keyAttribute = document.CreateAttribute("Alias"); 280 keyAttribute.Value = alias.Key; 281 aliasNode.Attributes.Append(keyAttribute); 282 XmlAttribute valueAttribute = document.CreateAttribute("Name"); 283 valueAttribute.Value = alias.Value; 284 aliasNode.Attributes.Append(valueAttribute); 285 aliases.AppendChild(aliasNode); 282 286 } 283 287 node.AppendChild(aliases); … … 303 307 if (aliases != null) { 304 308 foreach (XmlNode aliasNode in aliases.ChildNodes) 305 AddAlias(aliasNode. Name, aliasNode.InnerText);309 AddAlias(aliasNode.Attributes["Alias"].Value, aliasNode.Attributes["Name"].Value); 306 310 } 307 311
Note: See TracChangeset
for help on using the changeset viewer.