public ComponentEventInfo(ComponentEventType type) { Type = type; try { throw new Exception(); } catch (Exception ex) { StackTrace = ex.StackTrace; } Time = Environment.TickCount; }
/// <summary> /// Should be called everytime an event happens for a IComponent. /// </summary> /// <param name="component">The component.</param> /// <param name="eventType">Type of the event.</param> public static void NotifyEvent(IComponent component, ComponentEventType eventType) { ComponentReference componentReference; // Object is already tracked if (ObjectReferences.TryGetValue(component.Id, out componentReference)) { componentReference.Events.Add(new ComponentEventInfo(eventType)); if (eventType == ComponentEventType.Destroy) { componentReference.IsDestroyed = true; } } }