internal static Activity CreateActivity(Guid newGuid, bool emitTransfer) { Activity retval = null; if (DiagnosticTrace.ShouldCorrelate && (newGuid != Guid.Empty) && (newGuid != DiagnosticTrace.GetActivityId())) { retval = new Activity(ref newGuid, emitTransfer); } return(retval); }
private Activity(ref Guid newGuid, bool emitTransfer) { _emitTransfer = emitTransfer; if (DiagnosticTrace.ShouldCorrelate && newGuid != Guid.Empty) { _newGuid = newGuid; _oldGuid = DiagnosticTrace.GetActivityId(); if (_oldGuid != newGuid) { _mustDispose = true; if (_emitTransfer) { DiagnosticTrace.TraceTransfer(newGuid); } DiagnosticTrace.SetActivityId(newGuid); } } }