Ignore:
Timestamp:
02/23/21 16:36:44 (8 weeks ago)
Author:
dpiringe
Message:

#3026

  • removed property ConvertableType from all converters
  • removed the option to fixate or loosen the path of JsonItems (obsolete)
  • added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
  • unified the construction of exporter controls
  • code cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ResultJsonItemControl.cs

    r17834 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Data;
    5 using System.Drawing;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Threading.Tasks;
     1using System.Linq;
    92using System.Windows.Forms;
    103
    114namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    125  public partial class ResultJsonItemControl : UserControl {
    13     public ResultJsonItemControl() {
     6    private ResultJsonItemControl() {
    147      InitializeComponent();
    158    }
    169
    17     public static ResultJsonItemControl Create(ResultItemVM vm) {
    18       var control = new ResultJsonItemControl();
     10    protected ResultJsonItemControl(ResultItemVM vm) {
     11      InitializeComponent();
    1912      var formatters = ResultFormatter.ForType(vm.Item.ValueType).ToList();
    20       control.comboBoxFormatter.DataSource = formatters;
    21       control.comboBoxFormatter.DisplayMember = "Name";
    22      
     13      comboBoxFormatter.DataSource = formatters;
     14      comboBoxFormatter.DisplayMember = "Name";
     15
    2316      // set action to override the ResultFormatterType property for changing the selected value
    24       control.comboBoxFormatter.SelectedValueChanged += (s, e) => vm.ResultFormatterType = control.comboBoxFormatter.SelectedValue.GetType().FullName;
    25       control.comboBoxFormatter.SelectedItem = formatters.Last();
     17      comboBoxFormatter.SelectedValueChanged += (s, e) => vm.ResultFormatterType = comboBoxFormatter.SelectedValue.GetType().FullName;
     18      comboBoxFormatter.SelectedItem = formatters.Last();
     19    }
    2620
    27       return control;
    28     }
     21    public static ResultJsonItemControl Create(ResultItemVM vm) => new ResultJsonItemControl(vm);
    2922  }
    3023}
Note: See TracChangeset for help on using the changeset viewer.