UserCancellationException Constructors

Definition

Initializes an instance of the UserCancellationException class.

Overloads

UserCancellationException()

Initializes an instance of the UserCancellationException class.

UserCancellationException(String)

Initializes an instance of the UserCancellationException class with the specified error message.

UserCancellationException(SerializationInfo, StreamingContext)

Initializes an instance of the UserCancellationException class with serialized data.

UserCancellationException(String, Exception)

Initializes an instance of the UserCancellationException class with the specified error message and a reference to the inner exception that is the cause of this exception.

UserCancellationException()

Initializes an instance of the UserCancellationException class.

C#
public UserCancellationException();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

UserCancellationException(String)

Initializes an instance of the UserCancellationException class with the specified error message.

C#
public UserCancellationException(string message);

Parameters

message
String

The message that describes the error.

Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error and takes into account the current system culture.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

UserCancellationException(SerializationInfo, StreamingContext)

Initializes an instance of the UserCancellationException class with serialized data.

C#
protected UserCancellationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

The SerializationInfo object that contains the serialized object data about the exception being thrown.

context
StreamingContext

The StreamingContext object that contains contextual information about the source or destination.

Remarks

This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

UserCancellationException(String, Exception)

Initializes an instance of the UserCancellationException class with the specified error message and a reference to the inner exception that is the cause of this exception.

C#
public UserCancellationException(string message, Exception innerException);

Parameters

message
String

The message that describes the error.

innerException
Exception

The exception that is the cause of the current exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1