/// <summary> /// Called when the test completes. /// </summary> public void TestComplete(object state) { if (InvokeRequired) { BeginInvoke(new WaitCallback(TestComplete), state); return; } try { ProgressCTRL.Value = ProgressCTRL.Maximum; ResultsCTRL.Add((PerformanceTestResult)state); } catch (Exception e) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), e); } }
/// <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; }