5 // Jason Diamond (jason@injektilo.org)
7 // (C) 2002 Jason Diamond http://injektilo.org/
11 using System.Runtime.Serialization;
16 public class XmlException : SystemException
29 public XmlException ()
34 public XmlException (string message, Exception innerException)
35 : base (message, innerException)
39 protected XmlException (SerializationInfo info, StreamingContext context)
40 : base (info, context)
42 this.lineNumber = info.GetInt32 ("lineNumber");
43 this.linePosition = info.GetInt32 ("linePosition");
47 internal XmlException (string message)
49 public XmlException (string message)
55 internal XmlException (IXmlLineInfo li, string message) : base (message)
58 this.lineNumber = li.LineNumber;
59 this.linePosition = li.LinePosition;
64 internal XmlException (string message, int lineNumber, int linePosition)
66 public XmlException (string message, int lineNumber, int linePosition)
70 this.lineNumber = lineNumber;
71 this.linePosition = linePosition;
78 public int LineNumber {
79 get { return lineNumber; }
82 public int LinePosition {
83 get { return linePosition; }
86 public override string Message {
91 return String.Format ("{0} Line {1}, position {2}.",
92 base.Message, lineNumber, linePosition);
100 public override void GetObjectData (SerializationInfo info, StreamingContext context)
102 base.GetObjectData (info, context);
103 info.AddValue ("lineNumber", lineNumber);
104 info.AddValue ("linePosition", linePosition);