public static bool IsValid(ClientPerformanceCounterLevel level, ClientPerformanceCounterDetail detail)
        {
            bool flag  = Enum.IsDefined(typeof(ClientPerformanceCounterLevel), level);
            bool flag1 = Enum.IsDefined(typeof(ClientPerformanceCounterDetail), detail);

            if (flag)
            {
                return(flag1);
            }
            return(false);
        }
Пример #2
0
 protected void Initialize(ClientPerformanceCounterLevel compareLevel)
 {
     try
     {
         if (this.Scope.Level == compareLevel || this.Scope.Level == ClientPerformanceCounterLevel.All)
         {
             this.OnInitialize();
             this.Initialized = (this.CounterSetInstance == null ? false : this.Counters != null);
             MessagingClientEtwProvider.TraceClient(() => {
             });
         }
     }
     catch (Exception exception1)
     {
         Exception exception = exception1;
         if (!PerformanceCounter.IsCounterSetException(exception))
         {
             throw;
         }
         MessagingClientEtwProvider.TraceClient(() => MessagingClientEtwProvider.Provider.EventWritePerformanceCounterCreationFailed(exception.ToString()));
     }
 }
 public ClientPerformanceCounterScope(ClientPerformanceCounterLevel level, ClientPerformanceCounterDetail detail)
 {
     this.Level  = level;
     this.Detail = detail;
 }
 public ClientPerformanceCounterScope(ClientPerformanceCounterLevel level) : this(level, ClientPerformanceCounterDetail.Verbose)
 {
 }