Exemplo n.º 1
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 = "";
                        }
                    }
                }
            }));
        }
Exemplo n.º 2
0
            public bool TryGetFilteredFrameTime(EventFrame frame, out double result)
            {
                lock (criticalSection)
                {
                    if (!durations.TryGetValue(frame, out result))
                    {
                        if (loading.Contains(frame))
                        {
                            return(false);
                        }

                        if (frame.IsLoaded)
                        {
                            result = frame.CalculateFilteredTime(descriptions);
                            AddResult(frame, result);
                        }
                        else
                        {
                            Application.Current.Dispatcher.BeginInvoke(new Action(() => { AddResult(frame, frame.CalculateFilteredTime(descriptions)); }));
                            return(false);
                        }
                    }
                }
                return(true);
            }
Exemplo n.º 3
0
            void ProcessFrame(EventFrame frame, HashSet <Object> filter)
            {
                frame.Load();
                double duration = frame.CalculateFilteredTime(filter);

                lock (criticalSection)
                {
                    loading.Remove(frame);
                    durations.Add(frame, duration);
                }
            }