Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6494


Ignore:
Timestamp:
06/28/11 21:29:28 (13 years ago)
Author:
mkommend
Message:

#1479: Corrected renaming of symbols in tree view.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs

    r6493 r6494  
    118118      var groupSymbols = symbols.OfType<GroupSymbol>().ToList();
    119119      var topLevelSymbols = Content.Symbols.Where(s => !groupSymbols.Any(g => g.Symbols.Contains(s)));
    120       AddChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols);
     120      UpdateChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols);
    121121
    122122      RebuildImageList();
    123123    }
    124124
    125     private void AddChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {
     125    private void UpdateChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {
    126126      foreach (ISymbol symbol in symbols) {
    127127        TreeNode node = collection.Cast<TreeNode>().Where(n => n.Tag == symbol).FirstOrDefault();
    128128        if (node == null) {
    129129          node = new TreeNode();
    130           node.Name = symbol.Name;
    131           node.Text = symbol.Name;
    132130          node.Tag = symbol;
    133131          collection.Add(node);
    134132        }
    135133        node.Checked = symbol.Enabled;
     134        node.Text = symbol.Name;
     135
    136136        var groupSymbol = symbol as GroupSymbol;
    137         if (groupSymbol != null) AddChildTreeNodes(node.Nodes, groupSymbol.Symbols);
     137        if (groupSymbol != null) UpdateChildTreeNodes(node.Nodes, groupSymbol.Symbols);
    138138      }
    139139    }
Note: See TracChangeset for help on using the changeset viewer.