Exemplo n.º 1
0
        void AddListItemForPage(PropertyPage page)
        {
            int imageIndex = 0;

            Image image = page.Image;
            if (image != null)
            {
                imageList.Images.Add(image);
                imageIndex = imageList.Images.Count - 1;
            }

            ListViewItem item = new ListViewItem(page.Text, imageIndex);
            item.Tag = page;
            listView.Items.Add(item);
        }
Exemplo n.º 2
0
        private void listView_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (_activePage != null)
                _activePage.Visible = false;

            if (listView.SelectedItems.Count != 0)
            {
                ListViewItem selectedItem = listView.SelectedItems[0];
                PropertyPage page = (PropertyPage)selectedItem.Tag;
                _activePage = page;
            }

            if (_activePage != null)
            {
                _activePage.Visible = true;
                _activePage.OnSetActive();
            }
        }