mscorlib(4.0.0.0) API with additions
System.Reflection.TargetException Class Reference

Represents the exception that is thrown when an attempt is made to invoke an invalid target. More...

Inheritance diagram for System.Reflection.TargetException:
[legend]
Collaboration diagram for System.Reflection.TargetException:
[legend]

Public Member Functions

 TargetException ()
 Initializes a new instance of the T:System.Reflection.TargetException class with an empty message and the root cause of the exception. More...
 
 TargetException (string message)
 Initializes a new instance of the T:System.Reflection.TargetException class with the given message and the root cause exception. More...
 
 TargetException (string message, Exception inner)
 Initializes a new instance of the T:System.Reflection.TargetException 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.ApplicationException
 ApplicationException ()
 Initializes a new instance of the T:System.ApplicationException class. More...
 
 ApplicationException (string message)
 Initializes a new instance of the T:System.ApplicationException class with a specified error message. More...
 
 ApplicationException (string message, Exception innerException)
 Initializes a new instance of the T:System.ApplicationException 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...
 
virtual void GetObjectData (SerializationInfo info, StreamingContext context)
 When overridden in a derived class, sets the T:System.Runtime.Serialization.SerializationInfo with information about the 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

 TargetException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.Reflection.TargetException class with the specified serialization and context information. More...
 
- Protected Member Functions inherited from System.ApplicationException
 ApplicationException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.ApplicationException 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...
 

Additional Inherited Members

- 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

Represents the exception that is thrown when an attempt is made to invoke an invalid target.

Definition at line 9 of file TargetException.cs.

Constructor & Destructor Documentation

◆ TargetException() [1/4]

System.Reflection.TargetException.TargetException ( )

Initializes a new instance of the T:System.Reflection.TargetException class with an empty message and the root cause of the exception.

Definition at line 12 of file TargetException.cs.

◆ TargetException() [2/4]

System.Reflection.TargetException.TargetException ( string  message)

Initializes a new instance of the T:System.Reflection.TargetException class with the given message and the root cause exception.

Parameters
messageA String describing the reason why the exception occurred.

Definition at line 19 of file TargetException.cs.

◆ TargetException() [3/4]

System.Reflection.TargetException.TargetException ( string  message,
Exception  inner 
)

Initializes a new instance of the T:System.Reflection.TargetException 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.
innerThe exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Definition at line 28 of file TargetException.cs.

◆ TargetException() [4/4]

System.Reflection.TargetException.TargetException ( SerializationInfo  info,
StreamingContext  context 
)
protected

Initializes a new instance of the T:System.Reflection.TargetException class with the specified serialization and context information.

Parameters
infoThe data for serializing or deserializing the object.
contextThe source of and destination for the object.

Definition at line 37 of file TargetException.cs.


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