Beispiel #1
0
        private void UpdateTree()
        {
            m_RefreshButton.Enabled = false;
            m_TimeControl.Enabled   = false;

            var perspective = (TreePerspective)m_Perspective.SelectedItem;
            var time        = m_TimeControl.CurrentTime;

            Task.Run(() =>
            {
                try
                {
                    TraceReplayStateful.StatusDelegate replay_callback = (double ratio) =>
                    {
                        this.Invoke((Action) delegate()
                        {
                            m_ReplayProgress.Value = (int)Math.Round(1000.0 * ratio);
                        });
                    };

                    this.Invoke((Action) delegate() { m_StripStatus.Text = "Replaying events.."; });

                    TreeBuilderBase tree_builder;
                    tree_builder = new SnapshotTreeBuilder(m_Trace, time, replay_callback, perspective, m_Options);

                    this.Invoke((Action) delegate() { m_StripStatus.Text = "Building report tree.."; });

                    var root = tree_builder.BuildReportTree();

                    this.Invoke((Action) delegate()
                    {
                        OnTreeUpdated(root);
                    });
                }
                catch (Exception ex)
                {
                    this.Invoke((Action) delegate()
                    {
                        // Display an error and give up on this replay.
                        MessageBox.Show(this, ex.Message, "Error");
                        m_ReplayProgress.Value = 0;
                        m_StripStatus.Text     = "Error - badly structured stream. Fix the client application!";
                    });
                }
            });
        }
Beispiel #2
0
    private void UpdateTree()
    {
      m_RefreshButton.Enabled = false;
      m_TimeControl.Enabled = false;

      var perspective = (TreePerspective) m_Perspective.SelectedItem;
      var time = m_TimeControl.CurrentTime;

      Task.Run(() =>
      {
        try
        {
          TraceReplayStateful.StatusDelegate replay_callback = (double ratio) =>
          {
            this.Invoke((Action)delegate()
            {
              m_ReplayProgress.Value = (int)Math.Round(1000.0 * ratio);
            });
          };

          this.Invoke((Action)delegate() { m_StripStatus.Text = "Replaying events.."; });

          TreeBuilderBase tree_builder;
          tree_builder = new SnapshotTreeBuilder(m_Trace, time, replay_callback, perspective, m_Options);

          this.Invoke((Action)delegate() { m_StripStatus.Text = "Building report tree.."; });

          var root = tree_builder.BuildReportTree();

          this.Invoke((Action)delegate()
          {
            OnTreeUpdated(root);
          });
        }
        catch (Exception ex)
        {
          this.Invoke((Action)delegate()
          {
            // Display an error and give up on this replay.
            MessageBox.Show(this, ex.Message, "Error");
            m_ReplayProgress.Value = 0;
            m_StripStatus.Text = "Error - badly structured stream. Fix the client application!";
          });
        }
      });
    }