Changeset 6299 for branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs
- Timestamp:
- 05/26/11 15:11:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs
r6233 r6299 90 90 if (!(symbol is IReadOnlySymbol)) { 91 91 symbol.Changed += new EventHandler(symbol_Changed); 92 symbols.Add(symbol, symbol. InitialFrequency > 0.0);92 symbols.Add(symbol, symbol.Enabled); 93 93 } 94 94 } … … 101 101 private void symbol_Changed(object sender, EventArgs e) { 102 102 ISymbol symbol = (ISymbol)sender; 103 symbols.SetItemCheckedState(symbol, symbol. InitialFrequency > 0.0);103 symbols.SetItemCheckedState(symbol, symbol.Enabled); 104 104 } 105 105 106 106 private void symbols_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbol>> e) { 107 107 ICheckedItemList<ISymbol> checkedItemList = (ICheckedItemList<ISymbol>)sender; 108 foreach (var indexedItem in e.Items) { 109 if (checkedItemList.ItemChecked(indexedItem.Value)) { 110 indexedItem.Value.InitialFrequency = 1.0; 111 } else { 112 indexedItem.Value.InitialFrequency = 0.0; 113 } 114 } 108 foreach (var indexedItem in e.Items) 109 indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value); 115 110 } 116 111 private void ClearSymbols() {
Note: See TracChangeset
for help on using the changeset viewer.