Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/11 17:48:53 (13 years ago)
Author:
mkommend
Message:

#1479: Integrated trunk changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs

    r6415 r6618  
    5858      variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    5959      variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    60     }
     60      foreach (var variable in variableNamesView.Content) {
     61        variable.ValueChanged += new EventHandler(variable_ValueChanged);
     62      }
     63    }
     64
    6165
    6266    private void DeregisterVariableNamesViewContentEvents() {
     
    6569      variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    6670      variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
     71      foreach (var variable in variableNamesView.Content) {
     72        variable.ValueChanged -= new EventHandler(variable_ValueChanged);
     73      }
    6774    }
    6875
     
    103110    #region control event handlers
    104111    private void variableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> args) {
     112      if (args.Items != null)
     113        foreach (var newVar in args.Items)
     114          newVar.ValueChanged += new EventHandler(variable_ValueChanged);
     115      if (args.OldItems != null)
     116        foreach (var oldVar in args.OldItems)
     117          oldVar.ValueChanged -= new EventHandler(variable_ValueChanged);
     118      UpdateContent();
     119    }
     120
     121    private void variable_ValueChanged(object sender, EventArgs e) {
     122      UpdateContent();
     123    }
     124
     125    private void UpdateContent() {
    105126      if (Content != null) {
    106127        DeregisterContentEvents();
     
    109130      }
    110131    }
     132
    111133
    112134    private void weightMuTextBox_TextChanged(object sender, EventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.