4 using System.Collections.Generic;
5 using System.Diagnostics;
6 using System.Globalization;
9 namespace SiliconStudio.Core.Diagnostics
24 CreationTime = creationTime;
26 Object =
new WeakReference(component);
27 Events =
new List<ComponentEventInfo>();
35 StackTrace = ex.StackTrace;
43 public string StackTrace {
get;
private set; }
45 public List<ComponentEventInfo> Events {
get;
private set; }
53 public bool IsDestroyed {
get;
internal set; }
59 public DateTime CreationTime {
get;
private set; }
65 public WeakReference Object {
get;
private set; }
73 get {
return this.Object.IsAlive; }
84 var component = this.Object.Target as
IComponent;
85 if (component == null)
88 var builder =
new StringBuilder();
89 builder.AppendFormat(CultureInfo.InvariantCulture,
"Active component Id: [{0}] Name: [{1}] Class: [{2}] Time [{3}] Stack: {4}", component.Id, component.Name, component.GetType().FullName, CreationTime, StackTrace).AppendLine();
90 return builder.ToString();
Contains information about a tracked component.
ComponentReference(DateTime creationTime, IComponent component)
Initializes a new instance of the ComponentReference class.
override string ToString()
Returns a System.String that represents this instance.
Base interface for all components.