public void Dispose()
{
if (!this.disposed)
{
if (this.args == null)
this.source.Trace(new MessageTraceEvent(TraceEventType.Stop, 0, this.displayName));
else
this.source.Trace(new MessageTraceEvent(TraceEventType.Stop, 0, this.displayName, args));
if (this.oldId != Guid.Empty)
{
if (this.args == null)
source.Trace(new TransferTraceEvent(this.oldId, this.newId + " > " + this.oldId, displayName));
else
source.Trace(new TransferTraceEvent(this.oldId, this.newId + " > " + this.oldId, displayName, args));
}
Trace.CorrelationManager.ActivityId = this.oldId;
}
this.disposed = true;
}
}