Пример #1
0
        void AddListItemForPage(OptionsPage page)
        {
            int imageIndex = 0;

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

            var item = new ListViewItem(page.Text, imageIndex) { Tag = page };
            listView.Items.Add(item);
        }
Пример #2
0
        private void listView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (activePage != null)
                activePage.Visible = false;

            if (listView.SelectedItems.Count != 0)
            {
                ListViewItem selectedItem = listView.SelectedItems[0];
                var page = (OptionsPage)selectedItem.Tag;
                activePage = page;
            }

            if (activePage != null)
            {
                activePage.Visible = true;
                activePage.OnSetActive();
            }
        }
Пример #3
0
        void AddListItemForPage(OptionsPage page)
        {
            int imageIndex = 0;

            Image image = page.Image;

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

            var item = new ListViewItem(page.Text, imageIndex)
            {
                Tag = page
            };

            listView.Items.Add(item);
        }
Пример #4
0
        private void listView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (activePage != null)
            {
                activePage.Visible = false;
            }

            if (listView.SelectedItems.Count != 0)
            {
                ListViewItem selectedItem = listView.SelectedItems[0];
                var          page         = (OptionsPage)selectedItem.Tag;
                activePage = page;
            }

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