Fixed MoveToParent issues with the navigator and attributes.
[mono.git] / mcs / class / System.XML / System.Xml / XmlException.cs
1 //
2 // XmlException.cs
3 //
4 // Author:
5 //   Jason Diamond (jason@injektilo.org)
6 //
7 // (C) 2002 Jason Diamond  http://injektilo.org/
8 //
9
10 using System;
11 using System.Runtime.Serialization;
12
13 namespace System.Xml
14 {
15         [Serializable]
16         public class XmlException : SystemException
17         {
18                 #region Fields
19
20                 string msg;     //  Cache message here because SystemException doesn't expose it
21                 int lineNumber;
22                 int linePosition;
23
24                 #endregion
25
26                 #region Constructors
27
28                 public XmlException (string message, Exception innerException) 
29                         : base (message, innerException)
30                 {
31                         msg = message;
32                 }
33
34                 protected XmlException (SerializationInfo info, StreamingContext context)
35                 {
36                         this.lineNumber = info.GetInt32 ("lineNumber");
37                         this.linePosition = info.GetInt32 ("linePosition");
38                 }
39
40                 internal XmlException (string message)
41                         : base (message)
42                 {
43                         msg = message;
44                 }
45
46                 internal XmlException (string message, int lineNumber, int linePosition) : base (message)
47                 {
48                         this.lineNumber = lineNumber;
49                         this.linePosition = linePosition;
50                 }
51
52                 #endregion
53
54                 #region Properties
55
56                 public int LineNumber {
57                         get { return lineNumber; }
58                 }
59
60                 public int LinePosition {
61                         get { return linePosition; }
62                 }
63
64                 public override string Message {
65                         get { return msg; }
66                 }
67
68                 #endregion
69
70                 #region Methods
71
72                 public override void GetObjectData (SerializationInfo info, StreamingContext context)
73                 {
74                         base.GetObjectData (info, context);
75                         info.AddValue ("lineNumber", lineNumber);
76                         info.AddValue ("linePosition", linePosition);
77                 }
78
79                 #endregion
80         }
81 }