Пример #1
0
 public ReturnType Execute()
 {
     this.ValidateInputData();
     return(ThreadContext.Set <ReturnType>(string.Format(CultureInfo.InvariantCulture, "{0}.Execute", new object[]
     {
         base.GetType().Name
     }), this.threadCounter, this.ClientContext, this.RequestLogger, new ThreadContext.ExecuteDelegate <ReturnType>(this.ExecuteWithPerformanceMeasurement)));
 }
Пример #2
0
        public static T Set <T>(string label, ThreadCounter threadCounter, ClientContext clientContext, RequestLogger requestLogger, ThreadContext.ExecuteDelegate <T> executeDelegate)
        {
            T result = default(T);

            ThreadContext.Set(label, threadCounter, clientContext, requestLogger, delegate()
            {
                result = executeDelegate();
            });
            return(result);
        }
Пример #3
0
 public static void SetWithExceptionHandling(string label, ThreadCounter threadCounter, ClientContext clientContext, RequestLogger requestLogger, ThreadContext.ExecuteDelegate executeDelegate)
 {
     ThreadContext.Set(label, threadCounter, clientContext, requestLogger, delegate()
     {
         try
         {
             GrayException.MapAndReportGrayExceptions(delegate()
             {
                 executeDelegate();
             });
         }
         catch (GrayException arg)
         {
             string arg2 = (clientContext != null) ? clientContext.IdentityForFilteredTracing : "none";
             ThreadContext.Tracer.TraceError <string, GrayException>(0L, "{0}: failed with exception: {1}", arg2, arg);
         }
     });
 }