Freigeben über


ObjectDisposedException Konstruktoren

Definition

Initialisiert eine neue Instanz der ObjectDisposedException-Klasse.

Überlädt

Name Beschreibung
ObjectDisposedException(String)

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit einer Zeichenfolge, die den Namen des verworfenen Objekts enthält.

ObjectDisposedException(SerializationInfo, StreamingContext)
Veraltet.

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit serialisierten Daten.

ObjectDisposedException(String, Exception)

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit einer angegebenen Fehlermeldung und einem Verweis auf die innere Ausnahme, die die Ursache dieser Ausnahme ist.

ObjectDisposedException(String, String)

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit dem angegebenen Objektnamen und der angegebenen Nachricht.

ObjectDisposedException(String)

Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit einer Zeichenfolge, die den Namen des verworfenen Objekts enthält.

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

Parameter

objectName
String

Eine Zeichenfolge, die den Namen des verworfenen Objekts enthält.

Hinweise

Die Message Eigenschaft wird in eine vom System bereitgestellte Meldung initialisiert, die den Fehler beschreibt und den objectName Parameter enthält. Diese Meldung berücksichtigt die aktuelle Systemkultur.

Die InnerException Eigenschaft der neuen Instanz wird initialisiert in null.

Wenn objectName ja null, enthält die Message Eigenschaft nur eine Fehlermeldung.

Gilt für:

ObjectDisposedException(SerializationInfo, StreamingContext)

Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs

Achtung

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit serialisierten Daten.

protected:
 ObjectDisposedException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected ObjectDisposedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected ObjectDisposedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new ObjectDisposedException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> ObjectDisposedException
new ObjectDisposedException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> ObjectDisposedException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameter

info
SerializationInfo

Das SerializationInfo Objekt enthält die serialisierten Objektdaten zu der Ausnahme, die ausgelöst wird.

context
StreamingContext

Die StreamingContext kontextbezogene Informationen zur Quelle oder zum Ziel.

Attribute

Gilt für:

ObjectDisposedException(String, Exception)

Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit einer angegebenen Fehlermeldung und einem Verweis auf die innere Ausnahme, die die Ursache dieser Ausnahme ist.

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

Parameter

message
String

Die Fehlermeldung, die den Grund für die Ausnahme erklärt.

innerException
Exception

Die Ausnahme, die die Ursache der aktuellen Ausnahme ist. Ist innerException dies nicht nullder Fehler, wird die aktuelle Ausnahme in einem catch Block ausgelöst, der die innere Ausnahme behandelt.

Hinweise

Eine Ausnahme, die als direktes Ergebnis einer vorherigen Ausnahme ausgelöst wird, sollte einen Verweis auf die vorherige Ausnahme in der InnerException Eigenschaft enthalten. Die InnerException Eigenschaft gibt denselben Wert zurück, der an den Konstruktor übergeben wird.

Gilt für:

ObjectDisposedException(String, String)

Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs
Quelle:
ObjectDisposedException.cs

Initialisiert eine neue Instanz der ObjectDisposedException Klasse mit dem angegebenen Objektnamen und der angegebenen Nachricht.

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

Parameter

objectName
String

Der Name des verworfenen Objekts.

message
String

Die Fehlermeldung, die den Grund für die Ausnahme erklärt.

Hinweise

Die InnerException Eigenschaft der neuen Instanz wird initialisiert in null.

Wenn objectName ja null, enthält die Message Eigenschaft nur eine Fehlermeldung.

Gilt für: