Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/17/11 14:35:58 (13 years ago)
Author:
svonolfe
Message:

Implemented review comments of swagner (#1425)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VNS/HeuristicLab.Operators/3.3/ScopeCleaner.cs

    r5609 r5735  
    3939      get { return CurrentScopeParameter.ActualValue; }
    4040    }
    41     public ValueParameter<BoolValue> ClearSubScopesParameter {
    42       get { return (ValueParameter<BoolValue>)Parameters["ClearSubScopes"]; }
    43     }
    44 
    45     [StorableHook(HookType.AfterDeserialization)]
    46     private void AfterDeserializationHook() {
    47       #region Backwards Compatibility
    48       if (!Parameters.ContainsKey("ClearSubScopes")) {
    49         Parameters.Add(new ValueParameter<BoolValue>("ClearSubScopes", "Indicates, if the subscopes should be cleared.", new BoolValue(false)));
    50       }
    51       #endregion
    52     }
    5341
    5442    [StorableConstructor]
     
    5846    }
    5947    public ScopeCleaner()
    60       : base() {
     48      : base() { 
    6149      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose variables and sub-scopes should be removed."));
    62       Parameters.Add(new ValueParameter<BoolValue>("ClearSubScopes", "Indicates, if the subscopes should be cleared.", new BoolValue(false)));
    6350    }
    6451
     
    6956    public override IOperation Apply() {
    7057      CurrentScope.Variables.Clear();
    71       if(ClearSubScopesParameter.Value.Value)
    72         CurrentScope.SubScopes.Clear();
     58      CurrentScope.SubScopes.Clear();
    7359      return base.Apply();
    7460    }
Note: See TracChangeset for help on using the changeset viewer.