Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/29/09 18:03:17 (16 years ago)
Author:
epitzer
Message:

Include event registration in deserialization of VariableInjector. (#603)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/VariableInjector.cs

    r1673 r1708  
    3333  public class VariableInjector : OperatorBase {
    3434
    35     [Storable]
    36     private Dictionary<IVariable, IVariableInfo> variableVariableInfoTable;
    37 
    38     [Storable]
     35    private Dictionary<IVariable, IVariableInfo> variableVariableInfoTable;   
    3936    private Dictionary<IVariableInfo, IVariable> variableInfoVariableTable;
    4037
     
    114111    }
    115112
     113    [Storable]
     114    private KeyValuePair<Dictionary<IVariableInfo, IVariable>, Dictionary<IVariable, IVariableInfo>> MappingPersistence {
     115      get {
     116        return new KeyValuePair<Dictionary<IVariableInfo, IVariable>, Dictionary<IVariable, IVariableInfo>>(
     117          variableInfoVariableTable, variableVariableInfoTable);
     118      }
     119      set {
     120        variableInfoVariableTable = value.Key;
     121        variableVariableInfoTable = value.Value;
     122        foreach (var pair in variableInfoVariableTable) {
     123          pair.Key.ActualNameChanged += new EventHandler(VariableInfo_ActualNameChanged);
     124          pair.Value.NameChanged += new EventHandler(Variable_NameChanged);         
     125        }
     126      }
     127    }
     128
    116129    private void CreateVariableInfo(IVariable variable) {
    117130      IVariableInfo info = new VariableInfo(Guid.NewGuid().ToString(), "Injected variable", variable.Value.GetType(), VariableKind.New);
Note: See TracChangeset for help on using the changeset viewer.