Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5238


Ignore:
Timestamp:
01/08/11 02:06:12 (14 years ago)
Author:
swagner
Message:

Adapted method GetListViewItemsForItem to work with null items (#1324)

Location:
trunk/sources/HeuristicLab.Core.Views/3.3
Files:
2 edited

Legend:

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

    r5237 r5238  
    207207    }
    208208    protected virtual IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
    209       return itemListViewItemMapping[item];
     209      if (item == null) {
     210        List<ListViewItem> listViewItems = new List<ListViewItem>();
     211        foreach (ListViewItem listViewItem in itemsListView.Items) {
     212          if (listViewItem.Tag == null) listViewItems.Add(listViewItem);
     213        }
     214        return listViewItems;
     215      } else {
     216        return itemListViewItemMapping[item];
     217      }
    210218    }
    211219
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r5237 r5238  
    210210    }
    211211    protected virtual IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
    212       return itemListViewItemMapping[item];
     212      if (item == null) {
     213        List<ListViewItem> listViewItems = new List<ListViewItem>();
     214        foreach (ListViewItem listViewItem in itemsListView.Items) {
     215          if (listViewItem.Tag == null) listViewItems.Add(listViewItem);
     216        }
     217        return listViewItems;
     218      } else {
     219        return itemListViewItemMapping[item];
     220      }
    213221    }
    214222
Note: See TracChangeset for help on using the changeset viewer.