Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3212


Ignore:
Timestamp:
03/25/10 03:05:28 (15 years ago)
Author:
swagner
Message:

Fixed parameter update in MultipleCallsOperator (#950).

File:
1 edited

Legend:

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

    r3211 r3212  
    3535  [StorableClass]
    3636  public abstract class MultipleCallsOperator : SingleSuccessorOperator {
    37     private List<OperatorParameter> operatorParameters;
     37    private List<IValueParameter<IOperator>> operatorParameters;
    3838
    3939    private OperatorList operators;
     
    5656    [StorableHook(HookType.AfterDeserialization)]
    5757    private void Initialize() {
    58       operatorParameters = new List<OperatorParameter>();
     58      operatorParameters = new List<IValueParameter<IOperator>>();
    5959      for (int i = 0; i < Operators.Count; i++) {
    60         OperatorParameter opParam = (OperatorParameter)Parameters[i.ToString()];
     60        IValueParameter<IOperator> opParam = (IValueParameter<IOperator>)Parameters[i.ToString()];
    6161        operatorParameters.Add(opParam);
    6262        opParam.ValueChanged += new EventHandler(opParam_ValueChanged);
     
    7272
    7373    private void UpdateOperatorParameters() {
    74       foreach (OperatorParameter opParam in operatorParameters) {
     74      foreach (IValueParameter<IOperator> opParam in operatorParameters) {
    7575        opParam.ValueChanged -= new EventHandler(opParam_ValueChanged);
    7676        Parameters.Remove(opParam.Name);
     
    7878      operatorParameters.Clear();
    7979      for (int i = 0; i < Operators.Count; i++) {
    80         OperatorParameter opParam = new OperatorParameter(i.ToString(), string.Empty, Operators[i]);
     80        IValueParameter<IOperator> opParam = new ValueParameter<IOperator>(i.ToString(), string.Empty, Operators[i]);
    8181        opParam.ValueChanged += new EventHandler(opParam_ValueChanged);
    8282        Parameters.Add(opParam);
     
    118118    }
    119119    private void opParam_ValueChanged(object sender, EventArgs e) {
    120       OperatorParameter opParam = (OperatorParameter)sender;
     120      IValueParameter<IOperator> opParam = (IValueParameter<IOperator>)sender;
    121121      operators[operatorParameters.IndexOf(opParam)] = opParam.Value;
    122122    }
Note: See TracChangeset for help on using the changeset viewer.