Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/12 14:30:35 (11 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.

File:
1 edited

Legend:

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

    r8099 r8853  
    9191    }
    9292
     93    private List<string> allVariableNames;
     94    [Storable]
     95    public IEnumerable<string> AllVariableNames {
     96      get { return allVariableNames; }
     97      set {
     98        if (value == null) throw new ArgumentNullException();
     99        allVariableNames.Clear();
     100        allVariableNames.AddRange(value);
     101        VariableNames = value;
     102      }
     103    }
     104
    93105    [Storable]
    94106    private double slopeInitializerMu;
     
    151163
    152164    #region persistence and cloning
     165    [StorableHook(HookType.AfterDeserialization)]
     166    private void AfterDeserialization() {
     167      if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) {
     168        allVariableNames = variableNames;
     169      }
     170    }
     171
    153172    [StorableConstructor]
    154173    private VariableCondition(bool deserializing) : base(deserializing) { }
     
    161180
    162181      variableNames = new List<string>(original.variableNames);
     182      allVariableNames = new List<string>(original.allVariableNames);
    163183
    164184      slopeInitializerMu = original.slopeInitializerMu;
     
    181201
    182202      variableNames = new List<string>();
     203      allVariableNames = new List<string>();
    183204
    184205      slopeInitializerMu = 0.0;
Note: See TracChangeset for help on using the changeset viewer.