Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ComponentEventInfo.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Core.Diagnostics
6 {
7  /// <summary>
8  /// Contains information about a AddReference/Release event.
9  /// </summary>
10  public class ComponentEventInfo
11  {
13  {
14  Type = type;
15  try
16  {
17  throw new Exception();
18  }
19  catch (Exception ex)
20  {
21  StackTrace = ex.StackTrace;
22  }
23 
24  Time = Environment.TickCount;
25  }
26 
27  /// <summary>
28  /// Gets the event type.
29  /// </summary>
30  public ComponentEventType Type { get; internal set; }
31 
32  /// <summary>
33  /// Gets the stack trace at the time of the event.
34  /// </summary>
35  public string StackTrace { get; internal set; }
36 
37  /// <summary>
38  /// Gets the time (from Environment.TickCount) at which the event happened.
39  /// </summary>
40  public int Time { get; internal set; }
41 
42  public override string ToString()
43  {
44  return string.Format("Event Type: [{0}] Time: [{1}]", Type, Time);
45  }
46  }
47 }
ComponentEventType
TODO: Update summary.
Contains information about a AddReference/Release event.