Beispiel #1
0
 public void Record(ITimelineEvent timelineEvent)
 {
     if (_isRecording)
     {
         var entry = new TimelineEntry
         {
             RecordTime    = GetCurrentAdjustedTime(),
             TimelineEvent = timelineEvent
         };
         _recordedEvents.Add(entry);
     }
 }
            public TimelineData(ITimelineEvent timelineEvent)
            {
                EventType = timelineEvent.EventType;
                Timestamp = timelineEvent.Timestamp;
                Category  = timelineEvent.Category;
                Name      = timelineEvent.Name;
                Data      = timelineEvent.Data;

                if (timelineEvent is ITimelineScope timelineScope)
                {
                    Duration = (long)timelineScope.Duration.TotalMilliseconds;
                    Children = timelineScope.Children.Select(x => new TimelineData(x)).ToArray();
                }
            }
Beispiel #3
0
        /// <summary>
        /// Builds a list of actions that need to be executed to produce the specified output items.
        /// </summary>
        public static HashSet <Action> GetActionsToExecute(List <Action> Actions, List <Action> PrerequisiteActions, CppDependencyCache CppDependencies, ActionHistory History, bool bIgnoreOutdatedImportLibraries)
        {
            ITimelineEvent GetActionsToExecuteTimer = Timeline.ScopeEvent("ActionGraph.GetActionsToExecute()");

            // Build a set of all actions needed for this target.
            Dictionary <Action, bool> IsActionOutdatedMap = new Dictionary <Action, bool>();

            foreach (Action Action in PrerequisiteActions)
            {
                IsActionOutdatedMap.Add(Action, true);
            }

            // For all targets, build a set of all actions that are outdated.
            Dictionary <Action, bool> OutdatedActionDictionary = new Dictionary <Action, bool>();

            GatherAllOutdatedActions(Actions, History, OutdatedActionDictionary, CppDependencies, bIgnoreOutdatedImportLibraries);

            // Build a list of actions that are both needed for this target and outdated.
            HashSet <Action> ActionsToExecute = new HashSet <Action>(Actions.Where(Action => Action.CommandPath != null && IsActionOutdatedMap.ContainsKey(Action) && OutdatedActionDictionary[Action]));

            GetActionsToExecuteTimer.Finish();

            return(ActionsToExecute);
        }
Beispiel #4
0
        public Vector? GetCenteringVector(ITimelineEvent target)
        {
            //if (target == null)                                                             // Only call during or after the arrange pass.
            //{
            //    return null;
            //}

            //var eventIndex = 0;

            //foreach (var timelineEvent in Events)
            //{
            //    if (timelineEvent == target)
            //    {
            //        break;
            //    }

            //    eventIndex++;
            //}

            //var eventControlLeftEdge = Ruler.ToPixels(Dates.Earliest(), target.Dates.Start.Earliest());
            //var eventControlHalfWidth = target.ActualWidth / 2;
            //var viewportHalfWidth = ActualWidth / 2;

            //var x = eventControlLeftEdge + eventControlHalfWidth - viewportHalfWidth;

            //var eventControlTopEdge = eventIndex * (EventHeight + EventSpacing);
            //var eventControlHalfHeight = target.ActualHeight / 2;
            //var viewportHalfHeight = ActualHeight / 2;

            //var y = eventControlTopEdge + eventControlHalfHeight - viewportHalfHeight;

            return new Vector(); // new Vector(x - HorizontalOffset, y - VerticalOffset);
        }
 private void AddEvent(ITimelineEvent ev)
 {
     m_HourlyActivity.Add(ev.Time.Ticks / TICKS_PER_HOUR * TICKS_PER_HOUR);
     m_DailyActivity.Add(ev.Time.Ticks / TICKS_PER_DAY * TICKS_PER_DAY);
     m_MonthlyActivity.Add(new DateTime(ev.Time.Year, ev.Time.Month, 1).Ticks);
     m_TimelineEvents.Add(ev);
 }