예제 #1
0
        private void TestAllBTN_Click(object sender, EventArgs e)
        {
            try {
                if (m_running)
                {
                    throw new InvalidOperationException("A test is already running.");
                }

                ResultsCTRL.Clear();
                OkBTN.Enabled = m_running = true;
                ThreadPool.QueueUserWorkItem(new WaitCallback(DoAllTests), null);
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
예제 #2
0
        /// <summary>
        /// Loads previously saved results.
        /// </summary>
        private void LoadResults(string filePath)
        {
            Stream istrm = File.OpenRead(filePath);
            DataContractSerializer serializer = new DataContractSerializer(typeof(PerformanceTestResult[]));

            PerformanceTestResult[] results = (PerformanceTestResult[])serializer.ReadObject(istrm);
            istrm.Close();

            ResultsCTRL.Clear();

            foreach (PerformanceTestResult result in results)
            {
                ResultsCTRL.Add(result);
            }

            m_filePath = filePath;
        }