Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/11/17 13:44:01 (7 years ago)
Author:
gkronber
Message:

#2698: merged r14381 r14382 r14384 r14388 r14418 r14425 from trunk to stable

Location:
stable
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.DataPreprocessing.Views

  • stable/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs

    r14382 r14963  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Drawing;
    2425using System.Linq;
     
    4344    }
    4445
    45     protected bool VariableIsChecked(string name) {
     46    protected bool IsVariableChecked(string name) {
    4647      return Content.VariableItemList.CheckedItems.Any(x => x.Value.Value == name);
    4748    }
    48 
     49    protected IList<string> GetCheckedVariables() {
     50      return checkedItemList.Content.CheckedItems.Select(i => i.Value.Value).ToList();
     51    }
    4952
    5053    protected override void OnContentChanged() {
     
    5356
    5457      if (Content.VariableItemList == null) {
    55         Content.VariableItemList = Content.CreateVariableItemList();
     58        IList<string> inputs = Content.PreprocessingData.InputVariables;
     59        if (Content.PreprocessingData.TargetVariable != null)
     60          inputs = inputs.Union(new[] { Content.PreprocessingData.TargetVariable }).ToList();
     61        Content.VariableItemList = Content.CreateVariableItemList(inputs);
    5662      } else {
    5763        var checkedNames = Content.VariableItemList.CheckedItems.Select(x => x.Value.Value);
    58         Content.VariableItemList = Content.CreateVariableItemList(checkedNames);
     64        Content.VariableItemList = Content.CreateVariableItemList(checkedNames.ToList());
    5965      }
    6066      Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged;
     
    6470      var inputAndTarget = Content.PreprocessingData.InputVariables.Union(target != null ? new[] { target } : new string[] { });
    6571      foreach (var col in Content.PreprocessingData.GetDoubleVariableNames().Except(inputAndTarget)) {
    66         var listViewItem = checkedItemList.ItemsListView.FindItemWithText(col);
     72        var listViewItem = checkedItemList.ItemsListView.FindItemWithText(col, false, 0, false);
    6773        listViewItem.ForeColor = Color.LightGray;
    6874      }
     
    103109      Content.VariableItemList.Add(new StringValue(name));
    104110      if (!Content.PreprocessingData.InputVariables.Contains(name) && Content.PreprocessingData.TargetVariable != name) {
    105         var listViewItem = checkedItemList.ItemsListView.FindItemWithText(name);
     111        var listViewItem = checkedItemList.ItemsListView.FindItemWithText(name, false, 0, false);
    106112        listViewItem.ForeColor = Color.LightGray;
    107113      }
Note: See TracChangeset for help on using the changeset viewer.