* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaValidationException.cs
1 //
2 // XmlSchemaValidationException.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // (C)2004 Novell Inc.
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 #if NET_2_0
32
33 using System;
34 using System.Globalization;
35 using System.Runtime.Serialization;
36 using System.Security.Permissions;
37
38 namespace System.Xml.Schema
39 {
40         [Serializable]
41         public class XmlSchemaValidationException : XmlSchemaException
42         {
43                 object source_object;
44
45                 public XmlSchemaValidationException ()
46                         : base ()
47                 {
48                 }
49
50                 public XmlSchemaValidationException (string message)
51                         : base (message)
52                 {
53                 }
54
55                 protected XmlSchemaValidationException (SerializationInfo info, StreamingContext context)
56                         : base (info, context)
57                 {
58                 }
59
60                 public XmlSchemaValidationException (string message, Exception innerException, int lineNumber, int linePosition)
61                         : base (message, lineNumber, linePosition, null, null, innerException)
62                 {
63                 }
64
65                 internal XmlSchemaValidationException (string message, int lineNumber, int linePosition,
66                         XmlSchemaObject sourceObject, string sourceUri, Exception innerException)
67                         : base (message, lineNumber, linePosition, sourceObject, sourceUri, innerException)
68                 {
69                 }
70
71                 internal XmlSchemaValidationException (string message, object sender,
72                         string sourceUri, XmlSchemaObject sourceObject, Exception innerException)
73                         : base (message, sender, sourceUri, sourceObject, innerException)
74                 {
75                 }
76
77                 internal XmlSchemaValidationException (string message, XmlSchemaObject sourceObject,
78                         Exception innerException)
79                         : base (message, sourceObject, innerException)
80                 {
81                 }
82
83                 public XmlSchemaValidationException (string message, Exception innerException)
84                         : base (message, innerException)
85                 {
86                 }
87
88                 [SecurityPermission (SecurityAction.LinkDemand,
89                         Flags=SecurityPermissionFlag.SerializationFormatter)]
90                 public override void GetObjectData (
91                         SerializationInfo info, StreamingContext context)
92                 {
93                         base.GetObjectData (info, context);
94                 }
95
96                 // Never use it. It actually does nothing even on MS.NET 2.0.
97                 protected internal void SetSourceObject (object o)
98                 {
99                         source_object = o;
100                 }
101
102                 public object SourceObject {
103                         get { return source_object; }
104                 }
105         }
106 }
107
108 #endif