128 lines
4.2 KiB
C#
128 lines
4.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Threading;
|
|
|
|
namespace System.Diagnostics
|
|
{
|
|
/// <summary>Provides trace event data specific to a thread and a process.</summary>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x020000FC RID: 252
|
|
public class TraceEventCache
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Diagnostics.TraceEventCache" /> class. </summary>
|
|
// Token: 0x060008EE RID: 2286 RVA: 0x0001740C File Offset: 0x0001560C
|
|
public TraceEventCache()
|
|
{
|
|
this.started = DateTime.Now;
|
|
this.manager = Trace.CorrelationManager;
|
|
this.callstack = Environment.StackTrace;
|
|
this.timestamp = Stopwatch.GetTimestamp();
|
|
this.thread = Thread.CurrentThread.Name;
|
|
this.process = Process.GetCurrentProcess().Id;
|
|
}
|
|
|
|
/// <summary>Gets the call stack for the current thread.</summary>
|
|
/// <returns>A string containing stack trace information. This value can be an empty string ("").</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
|
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000256 RID: 598
|
|
// (get) Token: 0x060008EF RID: 2287 RVA: 0x0001746C File Offset: 0x0001566C
|
|
public string Callstack
|
|
{
|
|
get
|
|
{
|
|
return this.callstack;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the date and time at which the event trace occurred.</summary>
|
|
/// <returns>A <see cref="T:System.DateTime" /> structure whose value is a date and time expressed in Coordinated Universal Time (UTC).</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000257 RID: 599
|
|
// (get) Token: 0x060008F0 RID: 2288 RVA: 0x00017474 File Offset: 0x00015674
|
|
public DateTime DateTime
|
|
{
|
|
get
|
|
{
|
|
return this.started;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the correlation data, contained in a stack. </summary>
|
|
/// <returns>A <see cref="T:System.Collections.Stack" /> containing correlation data.</returns>
|
|
/// <filterpriority>1</filterpriority>
|
|
// Token: 0x17000258 RID: 600
|
|
// (get) Token: 0x060008F1 RID: 2289 RVA: 0x0001747C File Offset: 0x0001567C
|
|
public Stack LogicalOperationStack
|
|
{
|
|
get
|
|
{
|
|
return this.manager.LogicalOperationStack;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the unique identifier of the current process.</summary>
|
|
/// <returns>The system-generated unique identifier of the current process.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000259 RID: 601
|
|
// (get) Token: 0x060008F2 RID: 2290 RVA: 0x0001748C File Offset: 0x0001568C
|
|
public int ProcessId
|
|
{
|
|
get
|
|
{
|
|
return this.process;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a unique identifier for the current managed thread. </summary>
|
|
/// <returns>A string that represents a unique integer identifier for this managed thread.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x1700025A RID: 602
|
|
// (get) Token: 0x060008F3 RID: 2291 RVA: 0x00017494 File Offset: 0x00015694
|
|
public string ThreadId
|
|
{
|
|
get
|
|
{
|
|
return this.thread;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the current number of ticks in the timer mechanism.</summary>
|
|
/// <returns>The tick counter value of the underlying timer mechanism.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x1700025B RID: 603
|
|
// (get) Token: 0x060008F4 RID: 2292 RVA: 0x0001749C File Offset: 0x0001569C
|
|
public long Timestamp
|
|
{
|
|
get
|
|
{
|
|
return this.timestamp;
|
|
}
|
|
}
|
|
|
|
// Token: 0x040002E4 RID: 740
|
|
private DateTime started;
|
|
|
|
// Token: 0x040002E5 RID: 741
|
|
private CorrelationManager manager;
|
|
|
|
// Token: 0x040002E6 RID: 742
|
|
private string callstack;
|
|
|
|
// Token: 0x040002E7 RID: 743
|
|
private string thread;
|
|
|
|
// Token: 0x040002E8 RID: 744
|
|
private int process;
|
|
|
|
// Token: 0x040002E9 RID: 745
|
|
private long timestamp;
|
|
}
|
|
}
|