Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6235 for trunk/sources


Ignore:
Timestamp:
05/19/11 15:46:40 (14 years ago)
Author:
mkommend
Message:

#1531: Corrected display of variable names in VariableNamesView.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs

    r6233 r6235  
    3333
    3434namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    35 
    3635  [View("Variable View")]
    3736  [Content(typeof(Variable), true)]
     
    138137      }
    139138    }
    140 
    141139    private void multiplicativeWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
    142140      double sigma;
     
    162160        RegisterVariableNamesViewContentEvents();
    163161      } else {
    164         var existingEntries = variableNamesView.Content.Select(x => x.Value);
     162        var existingEntries = variableNamesView.Content.ToList();
    165163
    166164        // temporarily deregister to prevent circular calling of events
    167165        DeregisterVariableNamesViewContentEvents();
    168166        // add additional entries
    169         foreach (var variableName in Content.VariableNames.Except(existingEntries)) {
     167        foreach (var variableName in Content.VariableNames.Except(existingEntries.Select(x => x.Value)))
    170168          variableNamesView.Content.Add(new StringValue(variableName), true);
    171         }
     169        foreach (var oldEntry in existingEntries.Where(x => !Content.VariableNames.Contains(x.Value)))
     170          variableNamesView.Content.Remove(oldEntry);
    172171        RegisterVariableNamesViewContentEvents();
    173172
Note: See TracChangeset for help on using the changeset viewer.