mscorlib(4.0.0.0) API with additions
System.ObjectDisposedException Class Reference

The exception that is thrown when an operation is performed on a disposed object. More...

Inheritance diagram for System.ObjectDisposedException:
[legend]
Collaboration diagram for System.ObjectDisposedException:
[legend]

Public Member Functions

 ObjectDisposedException (string objectName)
 Initializes a new instance of the T:System.ObjectDisposedException class with a string containing the name of the disposed object. More...
 
 ObjectDisposedException (string objectName, string message)
 Initializes a new instance of the T:System.ObjectDisposedException class with the specified object name and message. More...
 
 ObjectDisposedException (string message, Exception innerException)
 Initializes a new instance of the T:System.ObjectDisposedException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
override void GetObjectData (SerializationInfo info, StreamingContext context)
 Retrieves the T:System.Runtime.Serialization.SerializationInfo object with the parameter name and additional exception information. More...
 
- Public Member Functions inherited from System.InvalidOperationException
 InvalidOperationException ()
 Initializes a new instance of the T:System.InvalidOperationException class. More...
 
 InvalidOperationException (string message)
 Initializes a new instance of the T:System.InvalidOperationException class with a specified error message. More...
 
 InvalidOperationException (string message, Exception innerException)
 Initializes a new instance of the T:System.InvalidOperationException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
- Public Member Functions inherited from System.SystemException
 SystemException ()
 Initializes a new instance of the T:System.SystemException class. More...
 
 SystemException (string message)
 Initializes a new instance of the T:System.SystemException class with a specified error message. More...
 
 SystemException (string message, Exception innerException)
 Initializes a new instance of the T:System.SystemException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
- Public Member Functions inherited from System.Exception
 Exception ()
 Initializes a new instance of the T:System.Exception class. More...
 
 Exception (string message)
 Initializes a new instance of the T:System.Exception class with a specified error message. More...
 
 Exception (string message, Exception innerException)
 Initializes a new instance of the T:System.Exception class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
virtual Exception GetBaseException ()
 When overridden in a derived class, returns the T:System.Exception that is the root cause of one or more subsequent exceptions. More...
 
override string ToString ()
 Creates and returns a string representation of the current exception. More...
 
new Type GetType ()
 Gets the runtime type of the current instance. More...
 
- Public Member Functions inherited from System.Runtime.InteropServices._Exception
new bool Equals (object obj)
 Provides COM objects with version-independent access to the M:System.Object.Equals(System.Object) method. More...
 
new int GetHashCode ()
 Provides COM objects with version-independent access to the M:System.Object.GetHashCode method. More...
 

Protected Member Functions

 ObjectDisposedException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.ObjectDisposedException class with serialized data. More...
 
- Protected Member Functions inherited from System.InvalidOperationException
 InvalidOperationException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.InvalidOperationException class with serialized data. More...
 
- Protected Member Functions inherited from System.SystemException
 SystemException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.SystemException class with serialized data. More...
 
- Protected Member Functions inherited from System.Exception
 Exception (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.Exception class with serialized data. More...
 

Properties

override string Message [get]
 Gets the message that describes the error. More...
 
string ObjectName [get]
 Gets the name of the disposed object. More...
 
- Properties inherited from System.Exception
virtual string Message [get]
 Gets a message that describes the current exception. More...
 
virtual IDictionary Data [get]
 Gets a collection of key/value pairs that provide additional user-defined information about the exception. More...
 
Exception InnerException [get]
 Gets the T:System.Exception instance that caused the current exception. More...
 
MethodBase TargetSite [get]
 Gets the method that throws the current exception. More...
 
virtual string StackTrace [get]
 Gets a string representation of the immediate frames on the call stack. More...
 
virtual string HelpLink [get, set]
 Gets or sets a link to the help file associated with this exception. More...
 
virtual string Source [get, set]
 Gets or sets the name of the application or the object that causes the error. More...
 
int HResult [get, protected set]
 Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. More...
 
EventHandler< SafeSerializationEventArgsSerializeObjectState
 Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. More...
 
- Properties inherited from System.Runtime.InteropServices._Exception
string Message [get]
 Provides COM objects with version-independent access to the P:System.Exception.Message property. More...
 
string StackTrace [get]
 Provides COM objects with version-independent access to the P:System.Exception.StackTrace property. More...
 
string HelpLink [get, set]
 Provides COM objects with version-independent access to the P:System.Exception.HelpLink property. More...
 
string Source [get, set]
 Provides COM objects with version-independent access to the P:System.Exception.Source property. More...
 
Exception InnerException [get]
 Provides COM objects with version-independent access to the P:System.Exception.InnerException property. More...
 
MethodBase TargetSite [get]
 Provides COM objects with version-independent access to the P:System.Exception.TargetSite property. More...
 

Detailed Description

The exception that is thrown when an operation is performed on a disposed object.

Definition at line 11 of file ObjectDisposedException.cs.

Constructor & Destructor Documentation

◆ ObjectDisposedException() [1/4]

System.ObjectDisposedException.ObjectDisposedException ( string  objectName)

Initializes a new instance of the T:System.ObjectDisposedException class with a string containing the name of the disposed object.

Parameters
objectNameA string containing the name of the disposed object.

Definition at line 57 of file ObjectDisposedException.cs.

◆ ObjectDisposedException() [2/4]

System.ObjectDisposedException.ObjectDisposedException ( string  objectName,
string  message 
)

Initializes a new instance of the T:System.ObjectDisposedException class with the specified object name and message.

Parameters
objectNameThe name of the disposed object.
messageThe error message that explains the reason for the exception.

Definition at line 66 of file ObjectDisposedException.cs.

◆ ObjectDisposedException() [3/4]

System.ObjectDisposedException.ObjectDisposedException ( string  message,
Exception  innerException 
)

Initializes a new instance of the T:System.ObjectDisposedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Parameters
messageThe error message that explains the reason for the exception.
innerExceptionThe exception that is the cause of the current exception. If innerException is not null, the current exception is raised in a catch block that handles the inner exception.

Definition at line 77 of file ObjectDisposedException.cs.

◆ ObjectDisposedException() [4/4]

System.ObjectDisposedException.ObjectDisposedException ( SerializationInfo  info,
StreamingContext  context 
)
protected

Initializes a new instance of the T:System.ObjectDisposedException class with serialized data.

Parameters
infoThe T:System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.
contextThe T:System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.

Definition at line 86 of file ObjectDisposedException.cs.

Member Function Documentation

◆ GetObjectData()

override void System.ObjectDisposedException.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
virtual

Retrieves the T:System.Runtime.Serialization.SerializationInfo object with the parameter name and additional exception information.

Parameters
infoThe T:System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.
contextThe T:System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.

Reimplemented from System.Exception.

Definition at line 96 of file ObjectDisposedException.cs.

Property Documentation

◆ Message

override string System.ObjectDisposedException.Message
get

Gets the message that describes the error.

Returns
A string that describes the error.

Definition at line 19 of file ObjectDisposedException.cs.

◆ ObjectName

string System.ObjectDisposedException.ObjectName
get

Gets the name of the disposed object.

Returns
A string containing the name of the disposed object.

Definition at line 37 of file ObjectDisposedException.cs.


The documentation for this class was generated from the following file: