Changeset 10529 for stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
- Timestamp:
- 03/04/14 11:28:56 (11 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9613,10495
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r9456 r10529 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.