Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/07/11 17:06:40 (13 years ago)
Author:
cneumuel
Message:

#1215

  • fixed issues with wrongly configured operators by cloning the corresponding ValidValue object rather than instantiating a new operator
Location:
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueConfigurationCheckedItemList.cs

    r5184 r5231  
    7474        try {
    7575          IItem value = (IItem)objectSelectorDialog.Item.Clone();
    76           return new ValueConfiguration(value, value.GetType());
     76          if (value is NullValue) {
     77            return new NullValueConfiguration();
     78          } else {
     79            return new ValueConfiguration(value, value.GetType());
     80          }
    7781        }
    7882        catch (Exception ex) {
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueView.cs

    r5207 r5231  
    4646
    4747    private void setValueButton_Click(object sender, EventArgs e) {
    48       var typesWithoutNullValue = Content.ValidTypes.Where(x => x != typeof(NullValue));
    49       var instances = typesWithoutNullValue.Select(x => (IItem)Activator.CreateInstance(x));
    50       var groupedInstances = instances.GroupBy(x => ApplicationManager.Manager.GetDeclaringPlugin(x.GetType()).Name);
     48      //var typesWithoutNullValue = Content.ValidTypes.Where(x => x != typeof(NullValue));
     49      //var instances = typesWithoutNullValue.Select(x => (IItem)Activator.CreateInstance(x));
     50      //var groupedInstances = instances.GroupBy(x => ApplicationManager.Manager.GetDeclaringPlugin(x.GetType()).Name);
     51      //var objectSelectorDialog = new ObjectSelectorDialog<IItem>(groupedInstances);
    5152
    52       var objectSelectorDialog = new ObjectSelectorDialog<IItem>(groupedInstances);
     53      var withoutNullValue = Content.ValidValues.Where(x => x != null && !(x is NullValue));
     54      var objectSelectorDialog = new ObjectSelectorDialog<IItem>(withoutNullValue.GroupBy(x => ApplicationManager.Manager.GetDeclaringPlugin(x.GetType()).Name));
    5355      if (objectSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    5456        try {
Note: See TracChangeset for help on using the changeset viewer.