Esempio n. 1
0
        // StartBenchmark
        private void StartBenchmark_Click(object sender, EventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                if (MessageBox.Show("Benchmarks should be run outside the IDE. Do you want to continue?", "ImageListView Tests", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                {
                    return;
                }
            }

            benchMarking = true;

            if (ChooseBenchmarkPath.ShowDialog() == DialogResult.OK)
            {
                oldCM = imageListView.CacheMode;

                imageListView.Items.Clear();
                imageListView.CacheMode = Manina.Windows.Forms.CacheMode.Continuous;

                TestToolStrip.Enabled = false;
                imageListView.Enabled = false;
                EventsListBox.Enabled = false;

                benchMarking = true;
                CheckBenchmarkEndTimer.Enabled = true;

                benchmarkSW.Reset();
                benchmarkSW.Start();
                lastThumbnailTime    = 0;
                cachedThumbnailCount = 0;

                imageListView.SuspendLayout();
                foreach (string file in Directory.GetFiles(ChooseBenchmarkPath.SelectedPath))
                {
                    if (string.Compare(Path.GetExtension(file), ".jpg", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(Path.GetExtension(file), ".png", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(Path.GetExtension(file), ".gif", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(Path.GetExtension(file), ".bmp", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        imageListView.Items.Add(file);
                    }
                }
            }
        }
Esempio n. 2
0
        // StartBenchmark
        private void StartBenchmark_Click(object sender, EventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                if (MessageBox.Show("Benchmarks should be run outside the IDE. Do you want to continue?", "ImageListView Tests", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                    return;
            }

            benchMarking = true;

            if (ChooseBenchmarkPath.ShowDialog() == DialogResult.OK)
            {
                oldCM = imageListView.CacheMode;

                imageListView.Items.Clear();
                imageListView.CacheMode = Manina.Windows.Forms.CacheMode.Continuous;

                TestToolStrip.Enabled = false;
                imageListView.Enabled = false;
                EventsListBox.Enabled = false;

                benchMarking = true;
                CheckBenchmarkEndTimer.Enabled = true;

                benchmarkSW.Reset();
                benchmarkSW.Start();
                lastThumbnailTime = 0;
                cachedThumbnailCount = 0;

                imageListView.SuspendLayout();
                foreach (string file in Directory.GetFiles(ChooseBenchmarkPath.SelectedPath))
                    if (string.Compare(Path.GetExtension(file), ".jpg", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(Path.GetExtension(file), ".png", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(Path.GetExtension(file), ".gif", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(Path.GetExtension(file), ".bmp", StringComparison.OrdinalIgnoreCase) == 0)
                        imageListView.Items.Add(file);
            }
        }