コード例 #1
0
        void TrackMethodCalled()
        {
            if (PartialTrustHelpers.AppDomainFullyTrusted && this.performanceCountersEnabled)
            {
                using (new OperationContextScopeHelper(this.OperationContext))
                {
                    PerformanceCounters.MethodCalled(this.operationName);
                }

                if (System.Runtime.Interop.UnsafeNativeMethods.QueryPerformanceCounter(out this.beginTime) == 0)
                {
                    this.beginTime = -1;
                }
            }

            if (TD2.OperationCompletedIsEnabled() ||
                TD2.OperationFaultedIsEnabled() ||
                TD2.OperationFailedIsEnabled())
            {
                this.beginOperation = DateTime.UtcNow.Ticks;
            }

            if (TD2.OperationInvokedIsEnabled())
            {
                using (new OperationContextScopeHelper(this.OperationContext))
                {
                    TD2.OperationInvoked(this.eventTraceActivity, this.operationName, TraceUtility.GetCallerInfo(this.OperationContext));
                }
            }
        }