Exemplo n.º 1
0
        private void AddNewCustomBrowser(BrowserInfo customBrowser)
        {
            System.Diagnostics.Debug.Assert(listView1.Items.Count == AppConfig.CustomBrowsers.Count);

            // Store the new rule
            AppConfig.UnsavedChanges = true;
            AppConfig.CustomBrowsers.Add(customBrowser);

            // Display the new rule
            BrowserInfoListViewItem lvi = new BrowserInfoListViewItem(customBrowser);
            listView1.Items.Add(lvi);

            System.Diagnostics.Debug.Assert(listView1.Items.Count == AppConfig.CustomBrowsers.Count);
        }
Exemplo n.º 2
0
        public void DisplayCustomBrowsers(IEnumerable<BrowserInfo> browsers)
        {
            listView1.SmallImageList = new ImageList();
            listView1.SmallImageList.ColorDepth = ColorDepth.Depth32Bit;
            listView1.SmallImageList.ImageSize = new System.Drawing.Size(16, 16);

            listView1.Items.Clear();

            int n = 0;
            foreach (BrowserInfo browser in browsers)
            {
                listView1.SmallImageList.Images.Add(browser.Name, browser.Icon);

                BrowserInfoListViewItem lvi = new BrowserInfoListViewItem(browser);
                listView1.Items.Add(lvi);

                n++;
            }
        }