Ejemplo n.º 1
0
 internal static void ResetUnobservedExceptionHandler()
 {
     lock (lockObject)
     {
         unobservedExceptionHandler = null;
     }
 }
 internal static void ResetUnobservedExceptionHandler()
 {
     lock (lockObject)
     {
         unobservedExceptionHandler = null;
     }
 }
Ejemplo n.º 3
0
 internal static void SetUnobservedExceptionHandler(UnobservedExceptionDelegate handler)
 {
     lock (lockObject)
     {
         if (unobservedExceptionHandler != null && handler != null)
         {
             throw new InvalidOperationException("Calling SetUnobservedExceptionHandler the second time.");
         }
         unobservedExceptionHandler = handler;
     }
 }
 internal static void SetUnobservedExceptionHandler(UnobservedExceptionDelegate handler)
 {
     lock (lockObject)
     {
         if (unobservedExceptionHandler != null && handler != null)
         {
             throw new InvalidOperationException("Calling SetUnobservedExceptionHandler the second time.");
         }
         unobservedExceptionHandler = handler;
     }
 }
Ejemplo n.º 5
0
        internal static bool TrySetUnobservedExceptionHandler(UnobservedExceptionDelegate handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }
            lock (lockObject)
            {
                if (unobservedExceptionHandler != null)
                {
                    return(false);
                }

                unobservedExceptionHandler = handler;
            }

            return(true);
        }