Changeset 7589 for branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs
- Timestamp:
- 03/08/12 20:44:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs
r7573 r7589 21 21 22 22 using System; 23 using System.Collections; 24 using System.Collections.Generic; 23 25 using System.IO; 24 26 using System.Linq; … … 75 77 private void LoadResultsAsync(int batchSize) { 76 78 bool includeBinaryValues = includeBinaryValuesCheckBox.Checked; 79 IEnumerable<ValueName> valueNames = constraintsCheckedListBox.CheckedItems.Cast<ValueName>(); 77 80 78 81 Cursor = Cursors.AppStarting; … … 99 102 while (ids.Count() > 0) { 100 103 cancellationToken.ThrowIfCancellationRequested(); 101 runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x))); 104 if (AllValueNamesChecked()) { 105 runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x))); 106 } else { 107 runs.AddRange(QueryClient.Instance.GetRunsWithValues(ids.Take(batchSize), includeBinaryValues, valueNames).Select(x => ConvertToOptimizationRun(x))); 108 } 102 109 ids = ids.Skip(batchSize); 103 110 Invoke(new Action(() => { … … 146 153 } else { 147 154 CreateFilterView(); 155 CreateConstraintsView(); 148 156 filtersInfoPanel.Visible = false; 149 157 splitContainer.Enabled = true; … … 179 187 } 180 188 } 189 } 190 191 private void CreateConstraintsView() { 192 constraintsCheckedListBox.Items.Clear(); 193 constraintsCheckedListBox.Items.AddRange(QueryClient.Instance.ValueNames.ToArray()); 194 SetCheckedState(true); 181 195 } 182 196 … … 221 235 return null; 222 236 } 237 238 private void SetCheckedState(bool val) { 239 for (int i = 0; i < constraintsCheckedListBox.Items.Count; i++) { 240 constraintsCheckedListBox.SetItemChecked(i, val); 241 } 242 } 243 244 private bool AllValueNamesChecked() { 245 return constraintsCheckedListBox.Items.Count == constraintsCheckedListBox.CheckedItems.Count; 246 } 247 248 private void selectAllButton_Click(object sender, EventArgs e) { 249 SetCheckedState(true); 250 } 251 252 private void deselectAllButton_Click(object sender, EventArgs e) { 253 SetCheckedState(false); 254 } 223 255 } 224 256 }
Note: See TracChangeset
for help on using the changeset viewer.