Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/12 23:54:58 (13 years ago)
Author:
abeham
Message:

#1722

  • fixed some problems that were identified with the first existing FxCop rules (duplicate storable hook in ExternalEvaluationProblem, multiple wrong names)
  • generally renamed AttachEventHandlers to RegisterEventHandlers to be consistent
  • fixed some backwards compatible regions to use the format from the snippet and the comment
File:
1 edited

Legend:

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

    r7259 r7351  
    6161    }
    6262
    63     [StorableHook(HookType.AfterDeserialization)]
    64     private void AfterDeserializationHook() {
    65       #region Backwards Compatibility
    66       if (!Parameters.ContainsKey("SelectedOperator")) {
    67         Parameters.Add(new LookupParameter<StringValue>("SelectedOperator", "If the TraceSelectedOperator flag is set, the name of the operator is traced in this parameter."));
    68         SelectedOperatorParameter.Hidden = false;
    69       }
    70       if (!Parameters.ContainsKey("TraceSelectedOperator")) {
    71         Parameters.Add(new ValueParameter<BoolValue>("TraceSelectedOperator", "Indicates, if the selected operator should be traced.", new BoolValue(false)));
    72       }
    73       #endregion
    74     }
    75 
    7663    [StorableConstructor]
    7764    protected StochasticMultiBranch(bool deserializing) : base(deserializing) { }
     
    9077      Parameters.Add(new ValueParameter<BoolValue>("TraceSelectedOperator", "Indicates, if the selected operator should be traced.", new BoolValue(false)));
    9178      SelectedOperatorParameter.Hidden = false;
     79    }
     80
     81    [StorableHook(HookType.AfterDeserialization)]
     82    private void AfterDeserialization() {
     83      // BackwardsCompatibility3.3
     84      #region Backwards compatible code, remove with 3.4
     85      if (!Parameters.ContainsKey("SelectedOperator")) {
     86        Parameters.Add(new LookupParameter<StringValue>("SelectedOperator", "If the TraceSelectedOperator flag is set, the name of the operator is traced in this parameter."));
     87        SelectedOperatorParameter.Hidden = false;
     88      }
     89      if (!Parameters.ContainsKey("TraceSelectedOperator")) {
     90        Parameters.Add(new ValueParameter<BoolValue>("TraceSelectedOperator", "Indicates, if the selected operator should be traced.", new BoolValue(false)));
     91      }
     92      #endregion
    9293    }
    9394
Note: See TracChangeset for help on using the changeset viewer.