Changeset 6494
- Timestamp:
- 06/28/11 21:29:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
r6493 r6494 118 118 var groupSymbols = symbols.OfType<GroupSymbol>().ToList(); 119 119 var topLevelSymbols = Content.Symbols.Where(s => !groupSymbols.Any(g => g.Symbols.Contains(s))); 120 AddChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols);120 UpdateChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols); 121 121 122 122 RebuildImageList(); 123 123 } 124 124 125 private void AddChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {125 private void UpdateChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) { 126 126 foreach (ISymbol symbol in symbols) { 127 127 TreeNode node = collection.Cast<TreeNode>().Where(n => n.Tag == symbol).FirstOrDefault(); 128 128 if (node == null) { 129 129 node = new TreeNode(); 130 node.Name = symbol.Name;131 node.Text = symbol.Name;132 130 node.Tag = symbol; 133 131 collection.Add(node); 134 132 } 135 133 node.Checked = symbol.Enabled; 134 node.Text = symbol.Name; 135 136 136 var groupSymbol = symbol as GroupSymbol; 137 if (groupSymbol != null) AddChildTreeNodes(node.Nodes, groupSymbol.Symbols);137 if (groupSymbol != null) UpdateChildTreeNodes(node.Nodes, groupSymbol.Symbols); 138 138 } 139 139 }
Note: See TracChangeset
for help on using the changeset viewer.