void UpdateEventsLog()
        {
            if (m_Log == null)
            {
                return;
            }

            m_Log.Clear();

            List <long> activeEventTypes = new List <long>();

            foreach (var s in m_EventTypeFilter.m_State)
            {
                if (s.Value)
                {
                    activeEventTypes.Add(s.Key);
                }
            }

            bool allActive   = activeEventTypes.Count == m_EventTypeFilter.m_State.Count;
            bool allInactive = activeEventTypes.Count == 0;

            if (panel == null)
            {
                m_EventsLog.itemsSource = ToList();
                m_EventsLog.Refresh();
                return;
            }

            var calls = m_Debugger.GetBeginEndProcessedEvents(panel);

            if (calls == null)
            {
                m_EventsLog.itemsSource = ToList();
                m_EventsLog.Refresh();
                return;
            }

            if (!allInactive)
            {
                for (var lineIndex = 0; lineIndex < calls.Count; lineIndex++)
                {
                    var eventBase = calls[lineIndex].eventBase;
                    if (allActive || activeEventTypes.Contains(eventBase.eventTypeId))
                    {
                        var    eventDateTimeStr = eventBase.TimestampString() + " #" + eventBase.eventId;
                        string handler          = eventBase.eventBaseName;
                        string targetName       = (eventBase.target != null
                            ? EventDebugger.GetObjectDisplayName(eventBase.target)
                            : "<null>");
                        var line = new EventLogLine(lineIndex + 1, "[" + eventDateTimeStr + "]", handler, targetName, eventBase);
                        m_Log.AddLine(line);
                    }
                }
            }

            UpdateLogCount();
            BuildEventsLog();
        }
Ejemplo n.º 2
0
 public void AddLine(EventLogLine eventLogLine)
 {
     lines.Add(eventLogLine);
 }