Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/19 12:44:06 (4 years ago)
Author:
mkommend
Message:

#3044: Allowed modification of column within transformations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3044_variableScaling/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Transformations/Transformation.cs

    r17180 r17389  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     25using HEAL.Attic;
    2426using HeuristicLab.Common;
    2527using HeuristicLab.Core;
    2628using HeuristicLab.Data;
    2729using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2930
    3031namespace HeuristicLab.Problems.DataAnalysis {
     
    4546    public string Column {
    4647      get { return ColumnParameter.Value.Value; }
     48      set {
     49        if (value == null) throw new ArgumentNullException("column", "The provided value for the column is null.");
     50        if (value == Column) return;
     51
     52        var matchingParameterValue = ColumnParameter.ValidValues.FirstOrDefault(v => v.Value == value);
     53        ColumnParameter.Value = matchingParameterValue ?? throw new ArgumentException("The provided value is not valid as the column.", "column");
     54      }
    4755    }
    4856    #endregion
Note: See TracChangeset for help on using the changeset viewer.