예제 #1
0
        private void OpenTab(object source, TimeLine.FocusFrameEventArgs args)
        {
            Data.Frame frame = args.Frame;
            foreach (var tab in frameTabs.Items)
            {
                if (tab is CloseableTabItem)
                {
                    CloseableTabItem item = (CloseableTabItem)tab;
                    if (item.DataContext.Equals(frame))
                    {
                        frameTabs.SelectedItem = item;
                        return;
                    }
                }
            }

            CloseableTabItem tabItem = new CloseableTabItem()
            {
                Header = "Loading...", DataContext = frame
            };

            FrameInfo info = new FrameInfo()
            {
                Height = Double.NaN, Width = Double.NaN, DataContext = null
            };

            info.DataContextChanged      += new DependencyPropertyChangedEventHandler((object sender, DependencyPropertyChangedEventArgs e) => { tabItem.Header = frame.Description; });
            info.SelectedTreeNodeChanged += new SelectedTreeNodeChangedHandler(FrameInfo_OnSelectedTreeNodeChanged);
            info.SetFrame(frame);

            tabItem.Add(info);

            frameTabs.Items.Add(tabItem);
            frameTabs.SelectedItem = tabItem;
        }
예제 #2
0
        private void ApplyDescriptionFilterToFramesTimeLine(HashSet <Object> filter)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                Data.Frame frame = DataContext as Data.Frame;

                EventFrame eventFrame = frame as EventFrame;
                if (eventFrame != null)
                {
                    if (filter == null)
                    {
                        eventFrame.FilteredDescription = "";
                    }
                    else
                    {
                        double timeInMs = eventFrame.CalculateFilteredTime(filter);
                        if (timeInMs > 0)
                        {
                            eventFrame.FilteredDescription = String.Format("{0:0.000}", timeInMs);
                        }
                        else
                        {
                            eventFrame.FilteredDescription = "";
                        }
                    }
                }
            }));
        }
예제 #3
0
 void FrameInfo_OnSelectedTreeNodeChanged(Data.Frame frame, BaseTreeNode node)
 {
     if (node is EventNode && frame is EventFrame)
     {
         ThreadView.FocusOn(frame as EventFrame, node as EventNode);
     }
 }
예제 #4
0
        private void OpenTab(object source, TimeLine.FocusFrameEventArgs args)
        {
            Durable focusRange = null;

            if (args.Node != null)
            {
                focusRange = args.Node.Entry;
            }
            else if (args.Frame is EventFrame)
            {
                focusRange = (args.Frame as EventFrame).Header;
            }

            Data.Frame frame = args.Frame;
            foreach (var tab in frameTabs.Items)
            {
                if (tab is TabItem)
                {
                    TabItem item = (TabItem)tab;
                    if (item.DataContext.Equals(frame))
                    {
                        FrameInfo frameInfo = item.Content as FrameInfo;
                        frameTabs.SelectedItem = tab;
                        return;
                    }
                }
            }


            CloseableTabItem tabItem = new CloseableTabItem()
            {
                Header = "Loading...", DataContext = frame, CloseButtonEnabled = true
            };

            FrameInfo info = new FrameInfo(timeLine.Frames)
            {
                Height = Double.NaN, Width = Double.NaN, DataContext = null
            };

            info.DataContextChanged      += new DependencyPropertyChangedEventHandler((object sender, DependencyPropertyChangedEventArgs e) => { tabItem.Header = frame.Description; });
            info.SelectedTreeNodeChanged += new SelectedTreeNodeChangedHandler(FrameInfo_OnSelectedTreeNodeChanged);
            info.SetFrame(frame, focusRange);

            tabItem.AddFrameInfo(info);

            frameTabs.Items.Add(tabItem);
            frameTabs.SelectedItem = tabItem;

            info.FocusOnNode(focusRange);

/*
 *                      if (!string.IsNullOrEmpty(currFiltredText))
 *                      {
 *                              info.SummaryTable.FilterText.SetFilterText(currFiltredText);
 *                      }
 */
        }
예제 #5
0
 public virtual void SetFrame(Data.Frame frame, IDurable node)
 {
     if (this.frame != frame)
     {
         this.frame       = frame;
         this.DataContext = frame;
     }
     else if (node != null)
     {
         FocusOnNode(node);
     }
 }
예제 #6
0
        public override void SetFrame(Data.Frame frame, IDurable node)
        {
            if (frame is EventFrame)
            {
                if (SourceFrame == frame)
                {
                    return;
                }

                SourceFrame = frame;

                SamplingFrame samplingFrame = frame.Group.CreateSamplingFrame((frame as EventFrame).RootEntry.Description, CallstackType);
                base.SetFrame(samplingFrame, null);
            }
            else
            {
                base.SetFrame(frame, null);
            }
        }
예제 #7
0
 public void SetFrame(Data.Frame frame)
 {
     this.frame = frame;
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { frame.Load();  this.DataContext = frame; }));
 }
예제 #8
0
 public void SetFrame(Data.Frame frame)
 {
   this.frame = frame;
   Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { frame.Load();  this.DataContext = frame; }));
 }