internal static void ResetUnobservedExceptionHandler() { lock (lockObject) { unobservedExceptionHandler = null; } }
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 bool TrySetUnobservedExceptionHandler(UnobservedExceptionDelegate handler) { if (handler == null) { throw new ArgumentNullException(nameof(handler)); } lock (lockObject) { if (unobservedExceptionHandler != null) { return(false); } unobservedExceptionHandler = handler; } return(true); }