ObjectDisposedException ObjectDisposedException ObjectDisposedException ObjectDisposedException Constructors

定义

重载

ObjectDisposedException(String) ObjectDisposedException(String) ObjectDisposedException(String) ObjectDisposedException(String)

使用包含已释放对象名称的字符串初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with a string containing the name of the disposed object.

ObjectDisposedException(SerializationInfo, StreamingContext) ObjectDisposedException(SerializationInfo, StreamingContext) ObjectDisposedException(SerializationInfo, StreamingContext) ObjectDisposedException(SerializationInfo, StreamingContext)

用序列化数据初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with serialized data.

ObjectDisposedException(String, Exception) ObjectDisposedException(String, Exception) ObjectDisposedException(String, Exception) ObjectDisposedException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

ObjectDisposedException(String, String) ObjectDisposedException(String, String) ObjectDisposedException(String, String) ObjectDisposedException(String, String)

使用指定的对象名称和消息初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with the specified object name and message.

ObjectDisposedException(String) ObjectDisposedException(String) ObjectDisposedException(String) ObjectDisposedException(String)

使用包含已释放对象名称的字符串初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with a string containing the name of the disposed object.

public:
 ObjectDisposedException(System::String ^ objectName);
public ObjectDisposedException (string objectName);
new ObjectDisposedException : string -> ObjectDisposedException
Public Sub New (objectName As String)

参数

objectName
String String String String

包含已释放对象的名称的字符串。A string containing the name of the disposed object.

注解

Message属性初始化为系统提供的消息,用于描述该错误并包括objectName参数。The Message property is initialized to a system-supplied message that describes the error and includes the objectName parameter. 此消息将当前系统区域性考虑在内。This message takes into account the current system culture.

InnerException属性的新实例初始化为nullThe InnerException property of the new instance is initialized to null.

如果objectNamenull,则Message属性包含只有一条错误消息。If objectName is null, the Message property contains only an error message.

ObjectDisposedException(SerializationInfo, StreamingContext) ObjectDisposedException(SerializationInfo, StreamingContext) ObjectDisposedException(SerializationInfo, StreamingContext) ObjectDisposedException(SerializationInfo, StreamingContext)

用序列化数据初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with serialized data.

protected:
 ObjectDisposedException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected ObjectDisposedException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new ObjectDisposedException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> ObjectDisposedException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

包含有关所引发异常的序列化对象数据的 SerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.

context
StreamingContext StreamingContext StreamingContext StreamingContext

StreamingContext,它包含关于源或目标的上下文信息。The StreamingContext that contains contextual information about the source or destination.

ObjectDisposedException(String, Exception) ObjectDisposedException(String, Exception) ObjectDisposedException(String, Exception) ObjectDisposedException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 ObjectDisposedException(System::String ^ message, Exception ^ innerException);
public ObjectDisposedException (string message, Exception innerException);
new ObjectDisposedException : string * Exception -> ObjectDisposedException
Public Sub New (message As String, innerException As Exception)

参数

message
String String String String

解释异常原因的错误消息。The error message that explains the reason for the exception.

innerException
Exception Exception Exception Exception

导致当前异常的异常。The exception that is the cause of the current exception. 如果 innerException 不为 null,则在处理内部异常的 catch 块中引发当前异常。If innerException is not null, the current exception is raised in a catch block that handles the inner exception.

注解

因前一个异常而直接引发的异常应在 InnerException 属性中包含对前一个异常的引用。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. InnerException属性返回传递到构造函数的相同值。The InnerException property returns the same value that is passed into the constructor.

ObjectDisposedException(String, String) ObjectDisposedException(String, String) ObjectDisposedException(String, String) ObjectDisposedException(String, String)

使用指定的对象名称和消息初始化 ObjectDisposedException 类的新实例。Initializes a new instance of the ObjectDisposedException class with the specified object name and message.

public:
 ObjectDisposedException(System::String ^ objectName, System::String ^ message);
public ObjectDisposedException (string objectName, string message);
new ObjectDisposedException : string * string -> ObjectDisposedException
Public Sub New (objectName As String, message As String)

参数

objectName
String String String String

已释放的对象名。The name of the disposed object.

message
String String String String

解释异常原因的错误消息。The error message that explains the reason for the exception.

注解

InnerException属性的新实例初始化为nullThe InnerException property of the new instance is initialized to null.

如果objectNamenull,则Message属性包含只有一条错误消息。If objectName is null, the Message property contains only an error message.

适用于