Changeset 10343


Ignore:
Timestamp:
01/15/14 13:27:53 (9 years ago)
Author:
aesterer
Message:

Replaced list view mapping with tag property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs

    r10342 r10343  
    1919    private HistogramContent histogramContent;
    2020
    21     private Dictionary<ListViewItem, IItem> listViewItemItemMapping;
    22 
    2321    public DataPreprocessingView() {
    2422      InitializeComponent();
     
    3028    }
    3129
     30    //Create list view item for content list view
    3231    private ListViewItem CreateListViewItem(IItem item) {
    3332      ListViewItem listViewItem = new ListViewItem();
     
    3837      listViewItem.ImageIndex = contentListView.SmallImageList.Images.Count - 1;
    3938      listViewItem.Tag = item;
     39
    4040      return listViewItem;
    4141    }
     
    5454
    5555      //create view items
    56       listViewItemItemMapping = new Dictionary<ListViewItem, IItem>();
    5756      contentListView.SmallImageList = new ImageList();
    58       ListViewItem contentListViewItem = CreateListViewItem(dataGridContent);
    59       listViewItemItemMapping[contentListViewItem] = dataGridContent;
     57      ListViewItem contentListViewItem = CreateListViewItem(dataGridContent);   
     58      ListViewItem statisticsListViewItem = CreateListViewItem(statisticsContent);
     59      ListViewItem filterListViewItem = CreateListViewItem(filterContent);
     60      ListViewItem transformationListViewItem = CreateListViewItem(tranformationContent);
     61      ListViewItem lineChartListViewItem = CreateListViewItem(lineChartContent);
     62      ListViewItem histogramListViewItem = CreateListViewItem(histogramContent);
    6063
    61       ListViewItem statisticsListViewItem = CreateListViewItem(statisticsContent);
    62       listViewItemItemMapping[statisticsListViewItem] = statisticsContent;
    63 
    64       ListViewItem filterListViewItem = CreateListViewItem(filterContent);
    65       listViewItemItemMapping[filterListViewItem] = filterContent;
    66 
    67       ListViewItem transformationListViewItem = CreateListViewItem(tranformationContent);
    68       listViewItemItemMapping[transformationListViewItem] = tranformationContent;
    69 
    70       ListViewItem lineChartListViewItem = CreateListViewItem(lineChartContent);
    71       listViewItemItemMapping[lineChartListViewItem] = lineChartContent;
    72 
    73       ListViewItem histogramListViewItem = CreateListViewItem(histogramContent);
    74       listViewItemItemMapping[histogramListViewItem] = histogramContent;
    75 
    76       //add view items
     64      //add view items to content list view
    7765      contentListView.Items.Add(statisticsListViewItem);
    7866      contentListView.Items.Add(contentListViewItem);
     
    9785      if (contentListView.SelectedItems.Count > 0) {
    9886        ListViewItem listViewItem = (ListViewItem)contentListView.SelectedItems[0];
    99         //this.viewHost.Content = listViewItemItemMapping[listViewItem];
    10087        this.viewHost.Content = (IItem)listViewItem.Tag;
    10188      }
     
    10390
    10491    private void listView1_DoubleClick(object sender, EventArgs e) {
    105       ListViewItem listViewItem = (ListViewItem)contentListView.SelectedItems[0];
    106       MainFormManager.MainForm.ShowContent(listViewItemItemMapping[listViewItem]);
     92      if (contentListView.SelectedItems.Count > 0) {
     93        ListViewItem listViewItem = (ListViewItem)contentListView.SelectedItems[0];
     94        MainFormManager.MainForm.ShowContent((IItem)listViewItem.Tag);
     95      }
    10796    }
    10897
Note: See TracChangeset for help on using the changeset viewer.