Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/25/10 04:34:47 (15 years ago)
Author:
swagner
Message:

Removed that the engine can be set to null in EngineAlgorithmView (#893).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs

    r2998 r3214  
    8282          engineComboBox.Items.Add(name);
    8383        }
    84         engineTypes.Insert(0, null);
    85         engineComboBox.Items.Insert(0, "-");
    8684      }
    8785
     
    9189      } else {
    9290        if (Content.Engine == null)
    93           engineComboBox.SelectedIndex = engineTypes.IndexOf(null);
     91          engineComboBox.SelectedIndex = -1;
    9492        else
    9593          engineComboBox.SelectedIndex = engineTypes.IndexOf(Content.Engine.GetType());
     
    125123      else {
    126124        if (Content.Engine == null)
    127           engineComboBox.SelectedIndex = engineTypes.IndexOf(null);
     125          engineComboBox.SelectedIndex = -1;
    128126        else
    129127          engineComboBox.SelectedIndex = engineTypes.IndexOf(Content.Engine.GetType());
     
    135133    protected virtual void engineComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    136134      if (Content != null) {
    137         Type t = engineTypes[engineComboBox.SelectedIndex];
    138         if (t == null)
     135        if (engineComboBox.SelectedIndex == -1)
    139136          Content.Engine = null;
    140         else if ((Content.Engine == null) || (Content.Engine.GetType() != t))
    141           Content.Engine = (IEngine)Activator.CreateInstance(t);
     137        else {
     138          Type t = engineTypes[engineComboBox.SelectedIndex];
     139          if ((Content.Engine == null) || (Content.Engine.GetType() != t))
     140            Content.Engine = (IEngine)Activator.CreateInstance(t);
     141        }
    142142      }
    143143    }
Note: See TracChangeset for help on using the changeset viewer.