- Timestamp:
- 03/25/10 04:34:47 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs
r2998 r3214 82 82 engineComboBox.Items.Add(name); 83 83 } 84 engineTypes.Insert(0, null);85 engineComboBox.Items.Insert(0, "-");86 84 } 87 85 … … 91 89 } else { 92 90 if (Content.Engine == null) 93 engineComboBox.SelectedIndex = engineTypes.IndexOf(null);91 engineComboBox.SelectedIndex = -1; 94 92 else 95 93 engineComboBox.SelectedIndex = engineTypes.IndexOf(Content.Engine.GetType()); … … 125 123 else { 126 124 if (Content.Engine == null) 127 engineComboBox.SelectedIndex = engineTypes.IndexOf(null);125 engineComboBox.SelectedIndex = -1; 128 126 else 129 127 engineComboBox.SelectedIndex = engineTypes.IndexOf(Content.Engine.GetType()); … … 135 133 protected virtual void engineComboBox_SelectedIndexChanged(object sender, EventArgs e) { 136 134 if (Content != null) { 137 Type t = engineTypes[engineComboBox.SelectedIndex]; 138 if (t == null) 135 if (engineComboBox.SelectedIndex == -1) 139 136 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 } 142 142 } 143 143 }
Note: See TracChangeset
for help on using the changeset viewer.