Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/12 17:50:17 (13 years ago)
Author:
gkronber
Message:

#1081: merged r7266:7459 from the trunk into the time series prognosis branch.

Location:
branches/HeuristicLab.TimeSeries
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs

    r7268 r7460  
    127127    [StorableConstructor]
    128128    private ExternalEvaluationProblem(bool deserializing) : base(deserializing) { }
    129     [StorableHook(HookType.AfterDeserialization)]
    130     private void AfterDeserializationHook() {
    131       AttachEventHandlers();
    132     }
    133 
    134129    private ExternalEvaluationProblem(ExternalEvaluationProblem original, Cloner cloner)
    135130      : base(original, cloner) {
    136       AttachEventHandlers();
     131      RegisterEventHandlers();
    137132    }
    138133    public override IDeepCloneable Clone(Cloner cloner) {
     
    154149
    155150      InitializeOperators();
    156       AttachEventHandlers();
     151      RegisterEventHandlers();
    157152    }
    158153    [StorableHook(HookType.AfterDeserialization)]
     
    170165      }
    171166      #endregion
     167      RegisterEventHandlers();
    172168    }
    173169
     
    220216
    221217    #region Helper
    222     private void AttachEventHandlers() {
     218    private void RegisterEventHandlers() {
    223219      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
    224220      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.ExternalEvaluation/3.3/SolutionMessageBuilder.cs

    r7268 r7460  
    5252    [StorableHook(HookType.AfterDeserialization)]
    5353    private void AfterDeserialization() {
    54       AttachEventHandlers();
     54      // BackwardsCompatibility3.3
     55      #region Backwards compatible code, remove with 3.4
     56#pragma warning disable 0612
     57      if (converters != null) {
     58        if (convertersList == null) convertersList = new CheckedItemList<IItemToSolutionMessageConverter>();
     59        foreach (IItemToSolutionMessageConverter c in converters)
     60          convertersList.Add(c);
     61        converters.Clear();
     62        converters = null;
     63      }
     64#pragma warning restore 0612
     65      #endregion
     66      RegisterEventHandlers();
    5567    }
    5668
     
    5870      : base(original, cloner) {
    5971      convertersList = cloner.Clone(original.convertersList);
    60       AttachEventHandlers();
     72      RegisterEventHandlers();
    6173    }
    6274    public override IDeepCloneable Clone(Cloner cloner) {
     
    7587      convertersList.Add(new TimeSpanValueConverter());
    7688
    77       AttachEventHandlers();
     89      RegisterEventHandlers();
    7890    }
    7991
     
    93105    }
    94106
    95     private void AttachEventHandlers() {
    96       // BackwardsCompatibility3.3
    97       #region Backwards compatible code, remove with 3.4
    98 #pragma warning disable 0612
    99       if (converters != null) {
    100         if (convertersList == null) convertersList = new CheckedItemList<IItemToSolutionMessageConverter>();
    101         foreach (IItemToSolutionMessageConverter c in converters)
    102           convertersList.Add(c);
    103         converters.Clear();
    104         converters = null;
    105       }
    106 #pragma warning restore 0612
    107       #endregion
     107    private void RegisterEventHandlers() {
    108108      convertersList.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IItemToSolutionMessageConverter>>(convertersList_Changed);
    109109      convertersList.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IItemToSolutionMessageConverter>>(convertersList_Changed);
Note: See TracChangeset for help on using the changeset viewer.