Exemple #1
0
 /// <summary>Add a tracing interceptor to be notified of changes.</summary>
 /// <param name="interceptor">The tracing interceptor.</param>
 public static void AddTracingInterceptor(ICloudTracingInterceptor interceptor)
 {
     if (interceptor == null)
     {
         throw new ArgumentNullException("interceptor");
     }
     lock (TracingAdapter._lock)
     {
         TracingAdapter._interceptors.Add(interceptor);
         TracingAdapter._threadSafeInterceptors = new List <ICloudTracingInterceptor>((IEnumerable <ICloudTracingInterceptor>)TracingAdapter._interceptors);
     }
 }
        /// <summary>
        /// Add a tracing interceptor to be notified of changes.
        /// </summary>
        /// <param name="interceptor">The tracing interceptor.</param>
        public void AddTracingInterceptor(ICloudTracingInterceptor interceptor)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }

            lock (_lock)
            {
                _interceptors.Add(interceptor);
                _threadSafeInterceptors = new List <ICloudTracingInterceptor>(_interceptors);
            }
        }
        /// <summary>
        /// Add a tracing interceptor to be notified of changes.
        /// </summary>
        /// <param name="interceptor">The tracing interceptor.</param>
        public void AddTracingInterceptor(ICloudTracingInterceptor interceptor)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }

            lock (_lock)
            {
                _interceptors.Add(interceptor);
                _threadSafeInterceptors = new List<ICloudTracingInterceptor>(_interceptors);
            }
        }
Exemple #4
0
        /// <summary>
        /// Remove a tracing interceptor from change notifications.
        /// </summary>
        /// <param name="interceptor">The tracing interceptor.</param>
        /// <returns>
        /// True if the tracing interceptor was found and removed; false
        /// otherwise.
        /// </returns>
        public static bool RemoveTracingInterceptor(ICloudTracingInterceptor interceptor)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }
            bool flag = false;

            lock (TracingAdapter._lock)
            {
                flag = TracingAdapter._interceptors.Remove(interceptor);
                if (flag)
                {
                    TracingAdapter._threadSafeInterceptors = new List <ICloudTracingInterceptor>((IEnumerable <ICloudTracingInterceptor>)TracingAdapter._interceptors);
                }
            }
            return(flag);
        }
        /// <summary>
        /// Remove a tracing interceptor from change notifications.
        /// </summary>
        /// <param name="interceptor">The tracing interceptor.</param>
        /// <returns>
        /// True if the tracing interceptor was found and removed; false
        /// otherwise.
        /// </returns>
        public bool RemoveTracingInterceptor(ICloudTracingInterceptor interceptor)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }

            bool removed = false;

            lock (_lock)
            {
                removed = _interceptors.Remove(interceptor);
                if (removed)
                {
                    _threadSafeInterceptors = new List <ICloudTracingInterceptor>(_interceptors);
                }
            }
            return(removed);
        }
        /// <summary>
        /// Remove a tracing interceptor from change notifications.
        /// </summary>
        /// <param name="interceptor">The tracing interceptor.</param>
        /// <returns>
        /// True if the tracing interceptor was found and removed; false
        /// otherwise.
        /// </returns>
        public bool RemoveTracingInterceptor(ICloudTracingInterceptor interceptor)
        {
            if (interceptor == null)
            {
                throw new ArgumentNullException("interceptor");
            }

            bool removed = false;
            lock (_lock)
            {
                removed =_interceptors.Remove(interceptor);
                if (removed)
                {
                    _threadSafeInterceptors = new List<ICloudTracingInterceptor>(_interceptors);
                }
            }
            return removed;
        }