/// <summary> /// Handles the SelectedChanged event of the WebTestResultViewer control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="WebTestResultViewerExt.SelectionChangedEventArgs"/> instance containing the event data.</param> void WebTestResultViewer_SelectedChanged(object sender, WebTestResultViewerExt.SelectionChangedEventArgs e) { WebTestResultViewer x = (WebTestResultViewer)sender; foreach (UserControl userControl in m_controls[e.TestResultId]) { // Update the userControl in each result viewer. WebTestResultControl resultControl = userControl as WebTestResultControl; if (resultControl != null) { // Call the resultControl's Update method (This will be added in the next procedure). switch (e.SelectedItem.GetType().Name) { case "WebTestResultComment": WebTestResultComment u = (WebTestResultComment)e.SelectedItem; resultControl.UpdateComment(u); break; case "WebTestResultPage": resultControl.Update(e.WebTestRequestResult); break; case "WebTestResultLoopIteration": resultControl.UpdateGrid(); break; default: resultControl.UpdateGrid(); break; } } } }
/// <summary> /// Updates the comment. /// </summary> /// <param name="WebTestResults">The web test results.</param> public void UpdateComment(WebTestResultComment WebTestResults) { var sb = new StringBuilder(); sb.Append(@"{\rtf1\ansi\deff0"); sb.Append(@"{\colortbl;\red255\green0\blue0;\red0\green255\blue0;\red0\green0\blue255;}"); sb.Append(@"\b *************************COMMENT****************************** \b0 "); sb.Append(@" \line "); sb.Append(@" \line "); this.resultControlDataGridView.Text = ""; sb.Append(WebTestResults.Comment); sb.Append(@" \line "); sb.Append(@"}"); this.resultControlDataGridView.Rtf = sb.ToString(); }