[asp.net] Ignore JavaScript blocks enclosed in HTML comments
[mono.git] / mcs / class / System.Web / System.Web.Compilation / ParseException.cs
index c0b2ec2ce71ddde8abb0278269f08263d5a10b69..be46bbf813242d2b8b27c57bdc1773f80cfc8093 100644 (file)
 
 using System;
 using System.IO;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
 
 namespace System.Web.Compilation
 {
+       [Serializable]
        internal class ParseException : HtmlizedException
        {
                ILocation location;
                string fileText;
 
+               ParseException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
+                {
+                }
+               
                public ParseException (ILocation location, string message)
                        : this (location, message, null)
                {
@@ -84,6 +92,10 @@ namespace System.Web.Compilation
                                if (fileText != null)
                                        return fileText;
 
+                               string text = location != null ? location.FileText : null;
+                               if (text != null && text.Length > 0)
+                                       return text;
+                               
                                if (FileName == null)
                                        return null;
 
@@ -106,6 +118,12 @@ namespace System.Web.Compilation
                public override bool ErrorLinesPaired {
                        get { return true; }
                }
+
+               [SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
+               public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
+               {
+                       base.GetObjectData (info, ctx);
+               }
        }
 }