Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/12 14:30:35 (12 years ago)
Author:
sforsten
Message:

#1865: An additional property has been added, which contains all possible variable names. The old property "VariableNames" contains the variable names which can be used with a certain symbol (which are checked in the view).
The "AfterDeserialization" method makes sure that the new property is set.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols
Files:
2 edited

Legend:

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

    r8103 r8853  
    124124        RegisterVariableNamesViewContentEvents();
    125125      } else {
    126         var existingEntries = variableNamesView.Content.ToList();
    127 
    128126        // temporarily deregister to prevent circular calling of events
    129127        DeregisterVariableNamesViewContentEvents();
    130         // add additional entries
    131         foreach (var variableName in Content.VariableNames.Except(existingEntries.Select(x => x.Value)))
    132           variableNamesView.Content.Add(new StringValue(variableName), true);
    133         foreach (var oldEntry in existingEntries.Where(x => !Content.VariableNames.Contains(x.Value)))
    134           variableNamesView.Content.Remove(oldEntry);
     128        variableNamesView.Content.Clear();
     129        foreach (var variableName in Content.AllVariableNames) {
     130          variableNamesView.Content.Add(new StringValue(variableName), Content.VariableNames.Contains(variableName));
     131        }
    135132        RegisterVariableNamesViewContentEvents();
    136133
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs

    r8476 r8853  
    181181        RegisterVariableNamesViewContentEvents();
    182182      } else {
    183         var existingEntries = variableNamesView.Content.ToList();
    184 
    185183        // temporarily deregister to prevent circular calling of events
    186184        DeregisterVariableNamesViewContentEvents();
    187         // add additional entries
    188         foreach (var variableName in Content.VariableNames.Except(existingEntries.Select(x => x.Value)))
    189           variableNamesView.Content.Add(new StringValue(variableName), true);
    190         foreach (var oldEntry in existingEntries.Where(x => !Content.VariableNames.Contains(x.Value)))
    191           variableNamesView.Content.Remove(oldEntry);
     185        variableNamesView.Content.Clear();
     186        foreach (var variableName in Content.AllVariableNames) {
     187          variableNamesView.Content.Add(new StringValue(variableName), Content.VariableNames.Contains(variableName));
     188        }
    192189        RegisterVariableNamesViewContentEvents();
    193190
Note: See TracChangeset for help on using the changeset viewer.