Call SetEndOfSendNotification
[mono.git] / mcs / class / System.Web / System.Web / HttpCompileException.cs
index 98053b0563b09125bc34cdc40a879d5486a98ef6..0b5a464ceda2b62a17d2b35bdfef4e3c000bdb85 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.HttpCompileException.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-
+// 
+// System.Web.HttpCompileException.cs
+//
+// Authors:
+//     Tim Coleman (tim@timcoleman.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) Tim Coleman, 2002
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.CodeDom.Compiler;\r
-\r
-namespace System.Web {\r
-       public sealed class HttpCompileException : HttpException {\r
-\r
-               #region Fields\r
-\r
-               CompilerResults results;\r
-               string sourceCode;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               internal HttpCompileException (CompilerResults results, string sourceCode)\r
-                       : base ()\r
-               {\r
-                       this.results = results;\r
-                       this.sourceCode = sourceCode;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public CompilerResults Results {\r
-                       get { return results; }\r
-               }\r
-\r
-               public string SourceCode {\r
-                       get { return sourceCode; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.CodeDom.Compiler;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+
+namespace System.Web
+{
+       // CAS - no InheritanceDemand here as the class is sealed
+       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       [Serializable]
+       public sealed class HttpCompileException : HttpException
+       {
+               CompilerResults results;
+               string sourceCode;
+
+               public HttpCompileException ()
+               {
+               }
+
+               public HttpCompileException (string message)
+                       : base (message)
+               {
+               }
+
+               public HttpCompileException (string message, Exception innerException)
+                       : base (message, innerException)
+               {
+               }
+
+               public HttpCompileException (CompilerResults results, string sourceCode)
+               {
+                       this.results = results;
+                       this.sourceCode = sourceCode;
+               }
+
+
+               public CompilerResults Results {
+                       [AspNetHostingPermission (SecurityAction.Demand, Level = AspNetHostingPermissionLevel.High)]
+                       get { return results; }
+               }
+
+               public string SourceCode {
+                       [AspNetHostingPermission (SecurityAction.Demand, Level = AspNetHostingPermissionLevel.High)]
+                       get { return sourceCode; }
+               }
+
+               public override string Message {
+                       get { return base.Message; }
+               }
+
+               [SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
+               public override void GetObjectData (SerializationInfo info, StreamingContext context)
+               {
+                       base.GetObjectData (info, context);
+                       sourceCode = info.GetString ("sourcecode");
+                       results = (CompilerResults) info.GetValue ("results", typeof (CompilerResults));
+               }
+       }
+}