Esempio n. 1
0
        private void FiltersForm_Load(object sender, EventArgs e)
        {
            lvYearStat.Items.AddRange(Years.Select(item => new ListViewItem(item)).ToArray());
            lvConferenceStat.Items.AddRange(Conference.Select(item => new ListViewItem(item)).ToArray());
            lvTypeStat.Items.AddRange(Types.Select(item => new ListViewItem(item)).ToArray());
            lvSourceStat.Items.AddRange(Sources.Select(item => new ListViewItem(item)).ToArray());
            lvGeographyStat.Items.AddRange(Geography.Select(item => new ListViewItem(item)).ToArray());
            lvJournalStat.Items.AddRange(Journals.Select(item => new ListViewItem(item)).ToArray());

            foreach (TabPage tp in tabControlForStatistic.TabPages)
            {
                tp.Controls.OfType <ListView>().First().AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                tp.Controls.OfType <ListView>().First().Items.Cast <ListViewItem>().ToList().ForEach(
                    item =>
                    item.Checked = Contains(item.ListView.Name, item.SubItems[0].Text)
                    );
            }
        }