Free cookie consent management tool by TermsFeed Policy Generator

Changeset 57


Ignore:
Timestamp:
03/10/08 00:33:22 (17 years ago)
Author:
swagner
Message:

Worked on ticket #48

  • adapted persistence of scopes
  • minor other changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Modularization/HeuristicLab.Core/Scope.cs

    r56 r57  
    136136    }
    137137    public void AddAlias(string alias, string name) {
     138      RemoveAlias(alias);
    138139      if (alias != name) {
    139         if (myAliases.ContainsKey(alias))
    140           myAliases.Remove(alias);
    141140        myAliases.Add(alias, name);
    142141        OnAliasAdded(alias);
     
    277276      XmlNode aliases = document.CreateNode(XmlNodeType.Element, "Aliases", null);
    278277      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);
    282286      }
    283287      node.AppendChild(aliases);
     
    303307      if (aliases != null) {
    304308        foreach (XmlNode aliasNode in aliases.ChildNodes)
    305           AddAlias(aliasNode.Name, aliasNode.InnerText);
     309          AddAlias(aliasNode.Attributes["Alias"].Value, aliasNode.Attributes["Name"].Value);
    306310      }
    307311
Note: See TracChangeset for help on using the changeset viewer.