Beispiel #1
0
 /// <summary>
 /// Unregisters platform specific exception handlers.
 /// </summary>
 /// <param name="client">The ExceptionlessClient.</param>
 public static void Unregister(this ExceptionlessClient client)
 {
     client.Shutdown();
     client.UnregisterOnProcessExitHandler();
     client.SubmitSessionEnd();
     client.ProcessQueue();
 }
 /// <summary>
 /// Unregisters platform specific exception handlers.
 /// </summary>
 /// <param name="client">The ExceptionlessClient.</param>
 public static void Unregister(this ExceptionlessClient client)
 {
     client.Shutdown();
     client.UnregisterOnProcessExitHandler();
     if (client.Configuration.SessionsEnabled)
     {
         client.SubmitSessionEnd();
     }
     client.ProcessQueue();
 }
Beispiel #3
0
        /// <summary>
        /// Unregisters platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        public static void Unregister(this ExceptionlessClient client)
        {
            client.Shutdown();
            client.UnregisterApplicationThreadExceptionHandler();
            client.UnregisterOnProcessExitHandler();

            client.SubmittingEvent -= OnSubmittingEvent;

            client.SubmitSessionEnd();
            client.ProcessQueue();
        }
        /// <summary>
        /// Unregisters platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        public static void Shutdown(this ExceptionlessClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            client.UnregisterAppDomainUnhandledExceptionHandler();
            client.UnregisterOnProcessExitHandler();
            client.UnregisterTaskSchedulerUnobservedTaskExceptionHandler();

            client.ProcessQueue();
            if (client.Configuration.SessionsEnabled)
            {
                client.SubmitSessionEnd();
            }
        }
        private static void RegisterOnProcessExitHandler(this ExceptionlessClient client)
        {
            if (_onProcessExit == null)
            {
                _onProcessExit = (sender, args) => {
                    client.ProcessQueue();
                    client.SubmitSessionEnd();
                };
            }

            try {
                AppDomain.CurrentDomain.ProcessExit -= _onProcessExit;
                AppDomain.CurrentDomain.ProcessExit += _onProcessExit;
            } catch (Exception ex) {
                client.Configuration.Resolver.GetLog().Error(typeof(ExceptionlessExtensions), ex, "An error occurred while wiring up to the process exit event.");
            }
        }