public void OnProgress(ProgressInfo progressInfo)
 {
     if (Progress != null)
     {
         Progress(progressInfo);
     }
 }
 void StressTester_Progress(ProgressInfo obj)
 {
     try
     {
         BeginInvoke(new Action<ProgressInfo>(ShowProgress), obj);
     }
     catch (Exception ex)
     {
         Trace.WriteLine("StressTester_Progress Exception: " + ex.Message);
     }
 }
 public void OnProgress(ProgressInfo progressInfo)
 {
     if (Progress != null)
         Progress(progressInfo);
 }
        void ShowProgress(ProgressInfo progress)
        {
            string text = progress.RequestsProcessed.ToString("n0") +
                          " requests, " + progress.RequestsFailed.ToString("n0") + " failed | " +
                          progress.SecondsProcessed + " of " +
                          progress.TotalSecondsToProcessed + " secs ";
            if (progress.SecondsProcessed > 0)
                text += "| " + (progress.RequestsProcessed / progress.SecondsProcessed).ToString("n0") + " request/sec ";

            if (progress.RequestsFailed > 0)
                txtProcessingTime.ForeColor = Color.Red;
            else
                txtProcessingTime.ForeColor = Color.DarkGreen;

            ShowStatus(text, 3);
        }