Bloom.Edit.WebThumbNailList.WebThumbNailList C# (CSharp) Method

WebThumbNailList() public method

public WebThumbNailList ( ) : System
return System
        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";
                }
            }
        }