- Timestamp:
- 06/12/13 13:15:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r9456 r9613 255 255 if (e.KeyCode == Keys.Delete) { 256 256 if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) { 257 foreach (ListViewItem item in itemsListView.SelectedItems) 258 Content.Remove((IRun)item.Tag); 257 if (RunCollection != null) { 258 RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag)); 259 } else { 260 foreach (ListViewItem item in itemsListView.SelectedItems) 261 Content.Remove((IRun)item.Tag); 262 } 259 263 } 260 264 } … … 350 354 private void removeButton_Click(object sender, EventArgs e) { 351 355 if (itemsListView.SelectedItems.Count > 0) { 352 foreach (ListViewItem item in itemsListView.SelectedItems) 353 Content.Remove((IRun)item.Tag); 356 if (RunCollection != null) { 357 RunCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(i => (IRun)i.Tag)); 358 } else { 359 foreach (ListViewItem item in itemsListView.SelectedItems) 360 Content.Remove((IRun)item.Tag); 361 } 354 362 itemsListView.SelectedItems.Clear(); 355 363 } … … 377 385 try { 378 386 RunCollection.Modify(); 379 } finally { 387 } 388 finally { 380 389 ReadOnly = false; 381 390 }
Note: See TracChangeset
for help on using the changeset viewer.