mscorlib(4.0.0.0) API with additions
System.Xml.XmlException Class Reference

Returns detailed information about the last exception. More...

Inheritance diagram for System.Xml.XmlException:
[legend]
Collaboration diagram for System.Xml.XmlException:
[legend]

Public Member Functions

override void GetObjectData (SerializationInfo info, StreamingContext context)
 Streams all the XmlException properties into the T:System.Runtime.Serialization.SerializationInfo class for the given T:System.Runtime.Serialization.StreamingContext. More...
 
 XmlException ()
 Initializes a new instance of the XmlException class. More...
 
 XmlException (string message)
 Initializes a new instance of the XmlException class with a specified error message. More...
 
 XmlException (string message, Exception innerException)
 Initializes a new instance of the XmlException class. More...
 
 XmlException (string message, Exception innerException, int lineNumber, int linePosition)
 Initializes a new instance of the XmlException class with the specified message, inner exception, line number, and line position. 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...
 

Public Attributes

string SourceUri => sourceUri
 Gets the location of the XML file. More...
 

Protected Member Functions

 XmlException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the XmlException class using the information in the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext objects. 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

int LineNumber [get]
 Gets the line number indicating where the error occurred. More...
 
int LinePosition [get]
 Gets the line position indicating where the error occurred. More...
 
override string Message [get]
 Gets a message describing the current exception. 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

Returns detailed information about the last exception.

Definition at line 12 of file XmlException.cs.

Constructor & Destructor Documentation

◆ XmlException() [1/5]

System.Xml.XmlException.XmlException ( SerializationInfo  info,
StreamingContext  context 
)
protected

Initializes a new instance of the XmlException class using the information in the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext objects.

Parameters
infoThe SerializationInfo object containing all the properties of an XmlException.
contextThe StreamingContext object containing the context information.

Definition at line 76 of file XmlException.cs.

◆ XmlException() [2/5]

System.Xml.XmlException.XmlException ( )

Initializes a new instance of the XmlException class.

Definition at line 129 of file XmlException.cs.

◆ XmlException() [3/5]

System.Xml.XmlException.XmlException ( string  message)

Initializes a new instance of the XmlException class with a specified error message.

Parameters
messageThe error description.

Definition at line 137 of file XmlException.cs.

◆ XmlException() [4/5]

System.Xml.XmlException.XmlException ( string  message,
Exception  innerException 
)

Initializes a new instance of the XmlException class.

Parameters
messageThe description of the error condition.
innerExceptionThe T:System.Exception that threw the XmlException, if any. This value can be null.

Definition at line 146 of file XmlException.cs.

◆ XmlException() [5/5]

System.Xml.XmlException.XmlException ( string  message,
Exception  innerException,
int  lineNumber,
int  linePosition 
)

Initializes a new instance of the XmlException class with the specified message, inner exception, line number, and line position.

Parameters
messageThe error description.
innerExceptionThe exception that is the cause of the current exception. This value can be null.
lineNumberThe line number indicating where the error occurred.
linePositionThe line position indicating where the error occurred.

Definition at line 157 of file XmlException.cs.

Member Function Documentation

◆ GetObjectData()

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

Streams all the XmlException properties into the T:System.Runtime.Serialization.SerializationInfo class for the given T:System.Runtime.Serialization.StreamingContext.

Parameters
infoThe SerializationInfo object.
contextThe StreamingContext object.

Reimplemented from System.Exception.

Definition at line 116 of file XmlException.cs.

Member Data Documentation

◆ SourceUri

string System.Xml.XmlException.SourceUri => sourceUri

Gets the location of the XML file.

Returns
The source URI for the XML data. If there is no source URI, this property returns null.

Definition at line 53 of file XmlException.cs.

Property Documentation

◆ LineNumber

int System.Xml.XmlException.LineNumber
get

Gets the line number indicating where the error occurred.

Returns
The line number indicating where the error occurred.

Definition at line 31 of file XmlException.cs.

◆ LinePosition

int System.Xml.XmlException.LinePosition
get

Gets the line position indicating where the error occurred.

Returns
The line position indicating where the error occurred.

Definition at line 43 of file XmlException.cs.

◆ Message

override string System.Xml.XmlException.Message
get

Gets a message describing the current exception.

Returns
The error message that explains the reason for the exception.

Definition at line 59 of file XmlException.cs.


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