Changeset 8013
- Timestamp:
- 06/15/12 22:44:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/CreateExperimentDialog.cs
r8012 r8013 60 60 private HashSet<IValueParameter> boolParameters; 61 61 private Dictionary<IValueParameter, HashSet<IItem>> multipleChoiceParameters; 62 private IItem optionalNullChoice = new BoolValue(); // any item will do 62 63 63 64 private StringBuilder failedInstances; … … 161 162 ClearDetailsView(); 162 163 164 var isOptionalConstrainedValueParameter = typeof(OptionalConstrainedValueParameter<>).IsAssignableFrom(parameter.GetType().GetGenericTypeDefinition()); 163 165 var isConstrainedValueParameter = 164 typeof(OptionalConstrainedValueParameter<>).IsAssignableFrom(parameter.GetType().GetGenericTypeDefinition())166 isOptionalConstrainedValueParameter 165 167 || typeof(ConstrainedValueParameter<>).Equals(parameter.GetType().GetGenericTypeDefinition()); 166 168 … … 169 171 choicesListView.Tag = parameter; 170 172 173 if (isOptionalConstrainedValueParameter) { 174 choicesListView.Items.Add(new ListViewItem("-") { 175 Tag = optionalNullChoice, 176 Checked = multipleChoiceParameters.ContainsKey(parameter) 177 && multipleChoiceParameters[parameter].Contains(optionalNullChoice) 178 }); 179 } 171 180 dynamic constrainedValuedParameter = parameter; 172 181 dynamic validValues = constrainedValuedParameter.ValidValues; … … 797 806 foreach (var m in mcEnumerator.Current) { 798 807 dynamic variantParam = variant.Parameters[m.Key.Name]; 808 if (m.Value == optionalNullChoice) { 809 variantParam.Value = null; 810 variant.Name += m.Key.Name + "=null, "; 811 continue; 812 } 799 813 var variantEnumerator = ((IEnumerable<object>)variantParam.ValidValues).GetEnumerator(); 800 814 var originalEnumerator = ((IEnumerable<object>)((dynamic)m.Key).ValidValues).GetEnumerator();
Note: See TracChangeset
for help on using the changeset viewer.