namespace System.Xml
{
+ [Serializable]
public class XmlException : SystemException
{
#region Fields
+ string msg; // Cache message here because SystemException doesn't expose it
int lineNumber;
int linePosition;
public XmlException (string message, Exception innerException)
: base (message, innerException)
{
+ msg = message;
}
- [MonoTODO]
protected XmlException (SerializationInfo info, StreamingContext context)
{
- throw new NotImplementedException ();
+ this.lineNumber = info.GetInt32 ("lineNumber");
+ this.linePosition = info.GetInt32 ("linePosition");
}
- internal XmlException (string message) : base (message)
+ internal XmlException (string message)
+ : base (message)
{
+ msg = message;
}
internal XmlException (string message, int lineNumber, int linePosition) : base (message)
this.linePosition = linePosition;
}
- internal XmlException (string message, XmlInputSource inputSrc)
- {
- }
-
#endregion
#region Properties
- public int LineNumber
- {
+ public int LineNumber {
get { return lineNumber; }
}
- public int LinePosition
- {
+ public int LinePosition {
get { return linePosition; }
}
+ public override string Message {
+ get { return msg; }
+ }
+
+ #endregion
+
+ #region Methods
+
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+ info.AddValue ("lineNumber", lineNumber);
+ info.AddValue ("linePosition", linePosition);
+ }
+
#endregion
}
}