Changeset 8544


Ignore:
Timestamp:
08/30/12 16:08:24 (7 years ago)
Author:
jkarder
Message:

#1853: ValueView now uses the TypeSelectorDialog instead of the ObjectSelectorDialog

Location:
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views-3.3.csproj

    r8524 r8544  
    106106      <SubType>Code</SubType>
    107107    </Compile>
    108     <Compile Include="ObjectSelectorDialog.cs">
    109       <SubType>Form</SubType>
    110     </Compile>
    111     <Compile Include="ObjectSelectorDialog.Designer.cs">
    112       <DependentUpon>ObjectSelectorDialog.cs</DependentUpon>
    113     </Compile>
    114108    <Compile Include="OptimizableView.cs">
    115109      <SubType>UserControl</SubType>
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/ValueConfigurationViews/ValueView.cs

    r8535 r8544  
    2323using System.Linq;
    2424using System.Windows.Forms;
    25 using HeuristicLab.Core;
    2625using HeuristicLab.Core.Views;
    2726using HeuristicLab.MainForm;
     
    6665
    6766    private void setValueButton_Click(object sender, EventArgs e) {
     67      // TODO: valid values get lost if the value was set to be optimized before
    6868      var withoutNullValue = Content.ValidValues.Where(x => x != null && !(x is NullValue));
    69       var objectSelectorDialog = new ObjectSelectorDialog<IItem>(withoutNullValue.GroupBy(x => ApplicationManager.Manager.GetDeclaringPlugin(x.GetType()).Name));
    70       if (objectSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     69      var typeSelectorDialog = new TypeSelectorDialog();
     70      typeSelectorDialog.Caption = "Select Item";
     71      typeSelectorDialog.TypeSelector.Caption = "Available Items";
     72      typeSelectorDialog.TypeSelector.Configure(withoutNullValue.Select(x => x.GetType()), false, false, false);
     73      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    7174        try {
    72           Content.Value = objectSelectorDialog.Item;
     75          Content.Value = withoutNullValue.Single(x => x.GetType() == typeSelectorDialog.TypeSelector.SelectedType);
    7376          valueViewHost.Content = Content.Value;
    7477        }
Note: See TracChangeset for help on using the changeset viewer.