Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/29/12 09:22:21 (12 years ago)
Author:
jkarder
Message:

#1853:

  • enhanced combinations count calculation
  • restructured code
  • minor code improvements
  • added license information
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ValueConfigurations/RangeValueConfiguration.cs

    r8517 r8535  
    4646    [StorableConstructor]
    4747    protected RangeValueConfiguration(bool deserializing) : base(deserializing) { }
    48     public RangeValueConfiguration() {
    49 
    50     }
    5148    protected RangeValueConfiguration(RangeValueConfiguration original, Cloner cloner)
    5249      : base(original, cloner) {
     
    5451      RegisterRangeConstraintEvents();
    5552    }
     53    public RangeValueConfiguration() : base() { }
    5654    public RangeValueConfiguration(IItem value, Type valueDataType)
    5755      : base(value, valueDataType) {
     
    6866      }
    6967    }
    70     public override IDeepCloneable Clone(Cloner cloner) {
    71       return new RangeValueConfiguration(this, cloner);
    72     }
    7368    [StorableHook(HookType.AfterDeserialization)]
    7469    private void AfterDeserialization() {
    7570      RegisterRangeConstraintEvents();
    7671    }
     72    public override IDeepCloneable Clone(Cloner cloner) {
     73      return new RangeValueConfiguration(this, cloner);
     74    }
    7775    #endregion
    7876
    7977    private void RegisterRangeConstraintEvents() {
    80       if (this.RangeConstraint != null) this.RangeConstraint.ToStringChanged += new EventHandler(RangeConstraint_ToStringChanged);
     78      if (this.RangeConstraint != null) {
     79        this.RangeConstraint.ToStringChanged += new EventHandler(RangeConstraint_ToStringChanged);
     80        this.RangeConstraint.LowerBoundChanged += new EventHandler(RangeConstraintParametersChanged);
     81        this.RangeConstraint.UpperBoundChanged += new EventHandler(RangeConstraintParametersChanged);
     82        this.RangeConstraint.StepSizeChanged += new EventHandler(RangeConstraintParametersChanged);
     83      }
    8184    }
     85
    8286    private void DeregisterRangeConstraintEvents() {
    83       if (this.RangeConstraint != null) this.RangeConstraint.ToStringChanged -= new EventHandler(RangeConstraint_ToStringChanged);
     87      if (this.RangeConstraint != null) {
     88        this.RangeConstraint.ToStringChanged -= new EventHandler(RangeConstraint_ToStringChanged);
     89        this.RangeConstraint.LowerBoundChanged -= new EventHandler(RangeConstraintParametersChanged);
     90        this.RangeConstraint.UpperBoundChanged -= new EventHandler(RangeConstraintParametersChanged);
     91        this.RangeConstraint.StepSizeChanged -= new EventHandler(RangeConstraintParametersChanged);
     92      }
    8493    }
    8594
     
    119128      OnToStringChanged();
    120129    }
     130    private void RangeConstraintParametersChanged(object sender, EventArgs e) {
     131      OnCombinationsCountChanged();
     132    }
    121133    #endregion
    122134  }
Note: See TracChangeset for help on using the changeset viewer.