System.UnhandledExceptionEventArgs Class

public class UnhandledExceptionEventArgs : EventArgs

Base Types

Object
  EventArgs
    UnhandledExceptionEventArgs

Assembly

mscorlib

Library

RuntimeInfrastructure

Summary

Provides data for the event that is raised when an exception is not caught by the program code executing in an application domain.

Description

UnhandledExceptionEventArgs provides access to the uncaught Exception and a property indicating whether the system will terminate the current process.

See Also

System Namespace

Members

UnhandledExceptionEventArgs Constructors

UnhandledExceptionEventArgs Constructor

UnhandledExceptionEventArgs Properties

UnhandledExceptionEventArgs.ExceptionObject Property
UnhandledExceptionEventArgs.IsTerminating Property


UnhandledExceptionEventArgs Constructor

public UnhandledExceptionEventArgs(object exception, bool isTerminating);

Summary

Constructs and initializes a new instance of the UnhandledExceptionEventArgs class.

Parameters

exception
The exception that was not caught.
isTerminating
true if the system will terminate the current process; otherwise, false .

Description

This constructor initializes the System.UnhandledExceptionEventArgs.ExceptionObject property using exception, and the System.UnhandledExceptionEventArgs.IsTerminating property using isTerminating.

See Also

System.UnhandledExceptionEventArgs Class, System Namespace

UnhandledExceptionEventArgs.ExceptionObject Property

public object ExceptionObject { get; }

Summary

Gets the uncaught exception.

Property Value

A Object, typically a Exception, that is the cause of the current event.

Description

This property is read-only.

See Also

System.UnhandledExceptionEventArgs Class, System Namespace

UnhandledExceptionEventArgs.IsTerminating Property

public bool IsTerminating { get; }

Summary

Gets a Boolean value indicating whether the system is terminating the current process.

Property Value

true if the system will end the current process as a result of the current unhandled exception; otherwise, false .

Description

This property is read-only.

[Note: This property returns true when an exception is received in, but not handled by, an application's main thread. This property also returns true if an unmanaged thread is executing managed code and receives an unhandled exception. System.UnhandledExceptionEventArgs.IsTerminating returns false for managed threads created by an application, and for unhandled exceptions thrown during object finalization.]

See Also

System.UnhandledExceptionEventArgs Class, System Namespace