ThrowHelper.ThrowObjectDisposedException Method

Definition

Overloads

ThrowObjectDisposedException(String)

Throws a new ObjectDisposedException.

ThrowObjectDisposedException(String, Exception)

Throws a new ObjectDisposedException.

ThrowObjectDisposedException(String, String)

Throws a new ObjectDisposedException.

ThrowObjectDisposedException<T>(String)

Throws a new ObjectDisposedException.

ThrowObjectDisposedException<T>(String, Exception)

Throws a new ObjectDisposedException.

ThrowObjectDisposedException<T>(String, String)

Throws a new ObjectDisposedException.

ThrowObjectDisposedException(String)

Throws a new ObjectDisposedException.

public static void ThrowObjectDisposedException (string? objectName);
static member ThrowObjectDisposedException : string -> unit
Public Shared Sub ThrowObjectDisposedException (objectName As String)

Parameters

objectName
String

The name of the disposed object.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowObjectDisposedException(String, Exception)

Throws a new ObjectDisposedException.

public static void ThrowObjectDisposedException (string? objectName, Exception? innerException);
static member ThrowObjectDisposedException : string * Exception -> unit
Public Shared Sub ThrowObjectDisposedException (objectName As String, innerException As Exception)

Parameters

objectName
String

The name of the disposed object.

innerException
Exception

The inner Exception to include.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowObjectDisposedException(String, String)

Throws a new ObjectDisposedException.

public static void ThrowObjectDisposedException (string? objectName, string? message);
static member ThrowObjectDisposedException : string * string -> unit
Public Shared Sub ThrowObjectDisposedException (objectName As String, message As String)

Parameters

objectName
String

The name of the disposed object.

message
String

The message to include in the exception.

Exceptions

Thrown with the specified parameters.

Applies to

ThrowObjectDisposedException<T>(String)

Throws a new ObjectDisposedException.

public static T ThrowObjectDisposedException<T> (string? objectName);
static member ThrowObjectDisposedException : string -> 'T
Public Shared Function ThrowObjectDisposedException(Of T) (objectName As String) As T

Type Parameters

T

The type of expected result.

Parameters

objectName
String

The name of the disposed object.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowObjectDisposedException<T>(String, Exception)

Throws a new ObjectDisposedException.

public static T ThrowObjectDisposedException<T> (string? objectName, Exception? innerException);
static member ThrowObjectDisposedException : string * Exception -> 'T
Public Shared Function ThrowObjectDisposedException(Of T) (objectName As String, innerException As Exception) As T

Type Parameters

T

The type of expected result.

Parameters

objectName
String

The name of the disposed object.

innerException
Exception

The inner Exception to include.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowObjectDisposedException<T>(String, String)

Throws a new ObjectDisposedException.

public static T ThrowObjectDisposedException<T> (string? objectName, string? message);
static member ThrowObjectDisposedException : string * string -> 'T
Public Shared Function ThrowObjectDisposedException(Of T) (objectName As String, message As String) As T

Type Parameters

T

The type of expected result.

Parameters

objectName
String

The name of the disposed object.

message
String

The message to include in the exception.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameters.

Applies to