Ejemplo n.º 1
0
        /// <summary>
        /// Windows the created.
        /// </summary>
        /// <param name="viewer">The viewer.</param>
        void WindowCreated(WebTestResultViewer viewer)
        {
            // Instantiate an instance of the resultControl referenced in the
            // WebPerfTestResultsViewerControl project.
            WebTestResultControl resultControl = new WebTestResultControl();

            //resultControl totalResultControl= new resultControl();
            // totalResultControl.Name="full";

            // Add to the dictionary of open playback windows.
            System.Diagnostics.Debug.Assert(!m_controls.ContainsKey(viewer.TestResultId));
            List <UserControl> userControls = new List <UserControl>();

            userControls.Add(resultControl);
            //userControls.Add(totalResultControl);

            // Add Guid to the m_control List to manage Result viewers and controls.
            m_controls.Add(viewer.TestResultId, userControls);

            // Add tabs to the playback control.
            resultControl.Dock = DockStyle.Fill;
            // totalResultControl.Dock=DockStyle.Fill;
            viewer.AddResultPage(new Guid(), "WebTest Log", resultControl);
            // viewer.AddResultPage(new Guid(), "WebTest full Log", totalResultControl);
        }
Ejemplo n.º 2
0
        /// <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;
                    }
                }
            }
        }