2009-05-18 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / class / System / System.Net / WebException.cs
index cfbc8fb46089e633ae9ab63de51a57877c6d7d89..6c8c295b4c4674386ac29214117a5397534385cb 100644 (file)
@@ -5,6 +5,27 @@
 //   Lawrence Pit (loz@cable.a2000.nl)\r
 //\r
 \r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
+\r
 using System.Runtime.Serialization;\r
 \r
 namespace System.Net \r
@@ -13,8 +34,7 @@ namespace System.Net
        public class WebException : InvalidOperationException, ISerializable\r
        {\r
                private WebResponse response;\r
-               private WebExceptionStatus status = WebExceptionStatus.RequestCanceled;\r
-               \r
+               private WebExceptionStatus status = WebExceptionStatus.UnknownError;\r
 \r
                // Constructors\r
                \r
@@ -26,9 +46,9 @@ namespace System.Net
                {\r
                }\r
 \r
-               protected WebException (SerializationInfo serializationInfo,\r
-                                       StreamingContext streamingContext)\r
-                       : base (serializationInfo, streamingContext)\r
+               protected WebException (SerializationInfo info,\r
+                                       StreamingContext context)\r
+                       : base (info, context)\r
                {\r
                }\r
 \r
@@ -47,7 +67,7 @@ namespace System.Net
                                    Exception innerException,\r
                                    WebExceptionStatus status, \r
                                    WebResponse response)\r
-                       : base (message, innerException)                                    \r
+                       : base (message, innerException)\r
                {\r
                        this.status = status;\r
                        this.response = response;\r
@@ -64,11 +84,19 @@ namespace System.Net
                }\r
                \r
                // Methods\r
-               \r
+#if !TARGET_JVM\r
                void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
                {\r
                        base.GetObjectData (info, context);\r
                }\r
+#endif \r
+\r
+#if NET_2_0\r
+               public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
+               {\r
+                       base.GetObjectData (serializationInfo,\r
+                                           streamingContext);\r
+               }\r
+#endif\r
        }\r
 }\r
-       \r