Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/11 14:39:21 (13 years ago)
Author:
abeham
Message:

#1660

  • Improved the performance of the RunCollectionView when working with larger number of runs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs

    r6693 r7065  
    238238    private void itemsListView_SelectedIndexChanged(object sender, EventArgs e) {
    239239      removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && (Content != null) && !Content.IsReadOnly && !ReadOnly;
    240       AdjustListViewColumnSizes();
     240      // for performance reason (multiple selection fires this handler for every selected item)
     241      if (itemsListView.SelectedIndices.Count <= 1)
     242        AdjustListViewColumnSizes();
    241243      if (showDetailsCheckBox.Checked) {
    242244        if (itemsListView.SelectedItems.Count == 1) {
     
    325327            items = items.Select(x => cloner.Clone(x));
    326328          }
    327           foreach (IRun item in items)
    328             Content.Add(item);
     329          if (RunCollection != null) {
     330            RunCollection.AddRange(items);
     331          } else { // the content is an IItemCollection<IRun>
     332            foreach (IRun item in items)
     333              Content.Add(item);
     334          }
    329335        }
    330336      }
Note: See TracChangeset for help on using the changeset viewer.