public WebThumbNailList() { InitializeComponent(); // this.Font = new System.Drawing.Font(SystemFonts.DialogFont.FontFamily, 9F); // _listView.LargeImageList = _thumbnailImageList; // _listView.Sorting = SortOrder.Ascending; // _listView.ListViewItemSorter = new SortListViewItemByIndex(); // _listView.OwnerDraw = true; // _listView.DrawItem+=new DrawListViewItemEventHandler(_listView_DrawItem); // _boundsPen = new Pen(Brushes.DarkGray, 2); // // _placeHolderImage = new Bitmap(32, 32); if (!ReallyDesignMode) { _browser = new Browser(); this._browser.BackColor = System.Drawing.Color.DarkGray; this._browser.Dock = System.Windows.Forms.DockStyle.Fill; this._browser.Location = new System.Drawing.Point(0, 0); this._browser.Name = "_browser"; this._browser.Size = new System.Drawing.Size(150, 491); this._browser.TabIndex = 0; _browser.ScaleToFullWidthOfPage = false; _browser.VerticalScroll.Visible = false; this.Controls.Add(_browser); } }
public WebThumbNailList() { InitializeComponent(); if (!ReallyDesignMode) { _browser = new Browser(); _browser.BackColor = Color.DarkGray; _browser.Dock = DockStyle.Fill; _browser.Location = new Point(0, 0); _browser.Name = "_browser"; _browser.Size = new Size(150, 491); _browser.TabIndex = 0; _browser.VerticalScroll.Visible = false; Controls.Add(_browser); } // set the thumbnail interval based on physical RAM if (string.IsNullOrEmpty(_thumbnailInterval)) { var memInfo = MemoryManagement.GetMemoryInformation(); // We need to divide by 1024 three times rather than dividing by Math.Pow(1024, 3) because the // later will force floating point math, producing incorrect results. var physicalMemGb = Convert.ToDecimal(memInfo.TotalPhysicalMemory) / 1024 / 1024 / 1024; if (physicalMemGb < 2.5M) // less than 2.5 GB physical RAM { _thumbnailInterval = "400"; } else if (physicalMemGb < 4M) // less than 4 GB physical RAM { _thumbnailInterval = "200"; } else // 4 GB or more physical RAM { _thumbnailInterval = "100"; } } }