Ejemplo n.º 1
0
        public void GetMemoryInformation_ReturnsMemoryInformation()
        {
            var memInfo = MemoryManagement.GetMemoryInformation();

            Assert.Greater(memInfo.TotalPhysicalMemory, 0);
            Assert.Greater(memInfo.TotalVirtualMemory, 0);
        }
Ejemplo n.º 2
0
        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";
                }
            }
        }
Ejemplo n.º 3
0
 public void FixtureSetUp()
 {
     Is64BitProcess         = IntPtr.Size == 8;
     HasLargePhysicalMemory = MemoryManagement.GetMemoryInformation().TotalPhysicalMemory >= 8192000000L;
 }