private void AddPage(PropertyPage page, ref Size maxPageSize)
        {
            pagePanel.Controls.Add(page);

            AddListItemForPage(page);

            // Adjust to fit the largest child page.
            if (page.Width > maxPageSize.Width)
                maxPageSize.Width = page.Width;
            if (page.Height > maxPageSize.Height)
                maxPageSize.Height = page.Height;

            // Set page.Dock *after* looking at its size.
            page.Dock = DockStyle.Fill;
            page.Visible = false;
        }
        private void AddListItemForPage(PropertyPage page)
        {
            int imageIndex = 0;

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

            var item = new ListViewItem(page.Title, imageIndex);
            item.Tag = page;

            listView.Items.Add(item);
        }
        private void AddListItemForPage(PropertyPage page)
        {
            int imageIndex = 0;

            var image = page.Image;

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

            var item = new ListViewItem(page.Title, imageIndex);

            item.Tag = page;

            listView.Items.Add(item);
        }
        private void AddPage(PropertyPage page, ref Size maxPageSize)
        {
            pagePanel.Controls.Add(page);

            AddListItemForPage(page);

            // Adjust to fit the largest child page.
            if (page.Width > maxPageSize.Width)
            {
                maxPageSize.Width = page.Width;
            }
            if (page.Height > maxPageSize.Height)
            {
                maxPageSize.Height = page.Height;
            }

            // Set page.Dock *after* looking at its size.
            page.Dock    = DockStyle.Fill;
            page.Visible = false;
        }
        private void listView_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (_activePage != null)
            {
                _activePage.Visible = false;
            }

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

            if (_activePage != null)
            {
                _activePage.Visible = true;
                _activePage.OnSetActive();
            }
        }
        private void listView_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (_activePage != null)
                _activePage.Visible = false;

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

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