コード例 #1
0
        public ComponentEventInfo(ComponentEventType type)
        {
            Type = type;
            try
            {
                throw new Exception();
            }
            catch (Exception ex)
            {
                StackTrace = ex.StackTrace;
            }

            Time = Environment.TickCount;
        }
コード例 #2
0
ファイル: ComponentEventInfo.cs プロジェクト: cg123/xenko
        public ComponentEventInfo(ComponentEventType type)
        {
            Type = type;
            try
            {
                throw new Exception();
            }
            catch (Exception ex)
            {
                StackTrace = ex.StackTrace;
            }

            Time = Environment.TickCount;
        }
コード例 #3
0
ファイル: ComponentTracker.cs プロジェクト: joewan/xenko
        /// <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;
                }
            }
        }
コード例 #4
0
 /// <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;
         }
     }
 }