コード例 #1
0
        public static CallTargetState BeginMethod <TIntegration, TTarget, TArg1, TArg2>(TTarget instance, TArg1 arg1, TArg2 arg2)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(BeginMethodHandler <TIntegration, TTarget, TArg1, TArg2> .Invoke(instance, ref arg1, ref arg2));
            }

            return(CallTargetState.GetDefault());
        }
コード例 #2
0
        public static CallTargetReturn <TReturn> EndMethod <TIntegration, TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception exception, CallTargetState state)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(EndMethodHandler <TIntegration, TTarget, TReturn> .Invoke(instance, returnValue, exception, in state));
            }

            return(new CallTargetReturn <TReturn>(returnValue));
        }
コード例 #3
0
        public static CallTargetState BeginMethod <TIntegration, TTarget>(TTarget instance, object[] arguments)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(BeginMethodSlowHandler <TIntegration, TTarget> .Invoke(instance, arguments));
            }

            return(CallTargetState.GetDefault());
        }
コード例 #4
0
        public static CallTargetReturn EndMethod <TIntegration, TTarget>(TTarget instance, Exception exception, CallTargetState state)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(EndMethodHandler <TIntegration, TTarget> .Invoke(instance, exception, in state));
            }

            return(CallTargetReturn.GetDefault());
        }
コード例 #5
0
        public static CallTargetState BeginMethod <TIntegration, TTarget, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(TTarget instance, ref TArg1 arg1, ref TArg2 arg2, ref TArg3 arg3, ref TArg4 arg4, ref TArg5 arg5, ref TArg6 arg6, ref TArg7 arg7, ref TArg8 arg8)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(BeginMethodHandler <TIntegration, TTarget, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> .Invoke(instance, ref arg1, ref arg2, ref arg3, ref arg4, ref arg5, ref arg6, ref arg7, ref arg8));
            }

            return(CallTargetState.GetDefault());
        }