public IDisposable TraceScope(string scope, params object[] parameters)
        {
            TraceEvent(TraceEventType.Verbose, WellKnownTraceCategory.TraceStartScope, InstrumentationUtility.SystemEventId.StartScope, InstrumentationUtility.Resources.FormatStringTraceScopeStart, scope, InstrumentationUtility.GetParameterList(parameters));
            var startTicks = HighResolutionTimer.CurrentTickCount;

            return(new AnonymousDisposable(() =>
            {
                long duration = HighResolutionTimer.Current.GetElapsedMilliseconds(startTicks);
                TraceEvent(TraceEventType.Verbose, WellKnownTraceCategory.TraceEndScope, InstrumentationUtility.SystemEventId.EndScope, InstrumentationUtility.Resources.FormatStringTraceScopeEndNoParams, scope, duration);
            }));
        }
 public void TraceOut(Guid callToken, params object[] outParameters)
 {
     TraceEvent(TraceEventType.Verbose, WellKnownTraceCategory.TraceOut, InstrumentationUtility.SystemEventId.MethodExit, InstrumentationUtility.Resources.FormatStringTraceOut, InstrumentationUtility.GetFullMethodName(InstrumentationUtility.GetCallingMethod()), outParameters != null & outParameters.Length > 0 ? InstrumentationUtility.GetParameterList(outParameters) : InstrumentationUtility.Resources.NoReturnValue, callToken);
 }
 public void TraceIn(Guid callToken)
 {
     TraceEvent(TraceEventType.Verbose, WellKnownTraceCategory.TraceIn, InstrumentationUtility.SystemEventId.MethodEntry, InstrumentationUtility.Resources.FormatStringTraceIn, InstrumentationUtility.GetFullMethodName(InstrumentationUtility.GetCallingMethod()), null, callToken);
 }
 public void TraceOut()
 {
     TraceEvent(TraceEventType.Verbose, WellKnownTraceCategory.TraceOut, InstrumentationUtility.SystemEventId.MethodExit, InstrumentationUtility.Resources.FormatStringTraceOutNoTokenAndParams, InstrumentationUtility.GetFullMethodName(InstrumentationUtility.GetCallingMethod()));
 }
        public Guid TraceIn(params object[] parameters)
        {
            Guid callToken = Guid.NewGuid();

            TraceEvent(TraceEventType.Verbose, WellKnownTraceCategory.TraceIn, InstrumentationUtility.SystemEventId.MethodEntry, InstrumentationUtility.Resources.FormatStringTraceIn, InstrumentationUtility.GetFullMethodName(InstrumentationUtility.GetCallingMethod()), InstrumentationUtility.GetParameterList(parameters), callToken);

            return(callToken);
        }