Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/08/11 01:47:47 (14 years ago)
Author:
swagner
Message:

#1324:

  • Added performance optimization in all other item collection views
  • Checked and refactored item event registration/deregistration
  • Enabled null items in item collection views
  • Moved non-default Dispose methods from designer files into user files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs

    r4068 r5237  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using System.Windows.Forms;
    2423using HeuristicLab.MainForm;
     
    3433    }
    3534
    36     private Dictionary<T, ListViewItem> listViewItemDictionary;
    37     protected Dictionary<T, ListViewItem> ListViewItemDictionary {
    38       get { return listViewItemDictionary; }
    39     }
    40 
    4135    public ItemSetView() {
    42       listViewItemDictionary = new Dictionary<T, ListViewItem>();
    4336      InitializeComponent();
    44     }
    45 
    46     protected override void OnContentChanged() {
    47       base.OnContentChanged();
    48       if (Content != null)
    49         Caption += " (" + Content.GetType().Name + ")";
    50     }
    51 
    52     protected override void AddListViewItem(ListViewItem listViewItem) {
    53       ListViewItemDictionary.Add((T)listViewItem.Tag, listViewItem);
    54       base.AddListViewItem(listViewItem);
    55     }
    56     protected override void RemoveListViewItem(ListViewItem listViewItem) {
    57       base.RemoveListViewItem(listViewItem);
    58       ListViewItemDictionary.Remove((T)listViewItem.Tag);
    59     }
    60     protected override IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
    61       return new ListViewItem[] { listViewItemDictionary[item] };
    6237    }
    6338  }
Note: See TracChangeset for help on using the changeset viewer.