5 // Jason Diamond (jason@injektilo.org)
7 // (C) 2002 Jason Diamond http://injektilo.org/
11 using System.Runtime.Serialization;
16 public class XmlException : SystemException
27 public XmlException (string message, Exception innerException)
28 : base (message, innerException)
32 protected XmlException (SerializationInfo info, StreamingContext context)
33 : base (info, context)
35 this.lineNumber = info.GetInt32 ("lineNumber");
36 this.linePosition = info.GetInt32 ("linePosition");
39 internal XmlException (string message)
44 internal XmlException (IXmlLineInfo li, string message) : base (message)
47 this.lineNumber = li.LineNumber;
48 this.linePosition = li.LinePosition;
52 internal XmlException (string message, int lineNumber, int linePosition) : base (message)
54 this.lineNumber = lineNumber;
55 this.linePosition = linePosition;
62 public int LineNumber {
63 get { return lineNumber; }
66 public int LinePosition {
67 get { return linePosition; }
70 public override string Message {
75 return String.Format ("{0} Line {1}, position {2}.",
76 base.Message, lineNumber, linePosition);
84 public override void GetObjectData (SerializationInfo info, StreamingContext context)
86 base.GetObjectData (info, context);
87 info.AddValue ("lineNumber", lineNumber);
88 info.AddValue ("linePosition", linePosition);