Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/04/14 11:28:56 (11 years ago)
Author:
gkronber
Message:

#1971: merged r9613 and r10495 from trunk into stable.

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r9456 r10529  
    255255      if (e.KeyCode == Keys.Delete) {
    256256        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          }
    259263        }
    260264      }
     
    350354    private void removeButton_Click(object sender, EventArgs e) {
    351355      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        }
    354362        itemsListView.SelectedItems.Clear();
    355363      }
     
    377385      try {
    378386        RunCollection.Modify();
    379       } finally {
     387      }
     388      finally {
    380389        ReadOnly = false;
    381390      }
Note: See TracChangeset for help on using the changeset viewer.