BindingFlags.Public needed here as Exception.HResult is now public in .NET 4.5. This...
[mono.git] / mcs / class / System.XML / System.Xml.Xsl / XsltCompileException.cs
1 //\r
2 // System.Xml.Xsl.XsltCompileException.cs\r
3 //\r
4 // Authors:\r
5 //  Tim Coleman (tim@timcoleman.com)\r
6 //  Andreas Nahr (ClassDevelopment@A-SoftTech.com)\r
7 //\r
8 // (C) Copyright 2002 Tim Coleman\r
9 // (C) 2003 Andreas Nahr\r
10 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)\r
11 //\r
12 // Permission is hereby granted, free of charge, to any person obtaining\r
13 // a copy of this software and associated documentation files (the\r
14 // "Software"), to deal in the Software without restriction, including\r
15 // without limitation the rights to use, copy, modify, merge, publish,\r
16 // distribute, sublicense, and/or sell copies of the Software, and to\r
17 // permit persons to whom the Software is furnished to do so, subject to\r
18 // the following conditions:\r
19 // \r
20 // The above copyright notice and this permission notice shall be\r
21 // included in all copies or substantial portions of the Software.\r
22 // \r
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
30 //\r
31 \r
32 using System.Runtime.Serialization;\r
33 using System.Xml.XPath;\r
34 using System.Security.Permissions;\r
35 \r
36 namespace System.Xml.Xsl\r
37 {\r
38         [Serializable]\r
39         public class XsltCompileException : XsltException\r
40         {\r
41                 #region Constructors\r
42 \r
43 #if NET_2_0\r
44                 public XsltCompileException ()\r
45                 {\r
46                 }\r
47 \r
48                 public XsltCompileException (string message)\r
49                         : base (message)\r
50                 {\r
51                 }\r
52 \r
53                 public XsltCompileException (string message, Exception innerException)\r
54                         : base (message, innerException)\r
55                 {\r
56                 }\r
57 #endif\r
58 \r
59                 protected XsltCompileException (SerializationInfo info, StreamingContext context )\r
60                         : base (info, context)\r
61                 {\r
62                 }\r
63 \r
64                 public XsltCompileException (Exception inner, String sourceUri, int lineNumber, int linePosition)\r
65 #if NET_2_0\r
66                         : base (lineNumber != 0 ? "{0} at {1}({2},{3}). See InnerException for details." : "{0}.",\r
67                                 "XSLT compile error", inner, lineNumber, linePosition, sourceUri)\r
68 #else\r
69                         : base ("{0}{1}({2},{3}) :\n", string.Empty, inner, lineNumber, linePosition, sourceUri)\r
70 #endif\r
71                 {\r
72                 }\r
73 \r
74                 internal XsltCompileException (string message, Exception innerException, XPathNavigator nav)\r
75                         : base (message, innerException, nav)\r
76                 {\r
77                 }\r
78                 #endregion\r
79 \r
80                 #region Properties\r
81 \r
82 #if NET_2_0\r
83 #else\r
84                 public override string Message {\r
85                         get { return base.Message; }\r
86                 }\r
87 #endif\r
88 \r
89                 #endregion\r
90 \r
91                 #region Methods\r
92 \r
93                 [SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]\r
94                 public override void GetObjectData (SerializationInfo info, StreamingContext context)\r
95                 {\r
96                         base.GetObjectData (info, context);\r
97                 }\r
98 \r
99                 #endregion\r
100         }\r
101 }\r