Changeset 5237 for trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs
- Timestamp:
- 01/08/11 01:47:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs
r4068 r5237 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using System.Windows.Forms; 24 23 using HeuristicLab.MainForm; … … 34 33 } 35 34 36 private Dictionary<T, ListViewItem> listViewItemDictionary;37 protected Dictionary<T, ListViewItem> ListViewItemDictionary {38 get { return listViewItemDictionary; }39 }40 41 35 public ItemSetView() { 42 listViewItemDictionary = new Dictionary<T, ListViewItem>();43 36 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] };62 37 } 63 38 }
Note: See TracChangeset
for help on using the changeset viewer.