ThrowHelper.ThrowObjectDisposedException Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
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.
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
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.
Returns
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
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameters.