Forráskód Böngészése

2004-05-18 Gonzalo Paniagua Javier <[email protected]>

	* WebException.cs: implemented serialization .ctor and GetObjectData().

svn path=/trunk/mcs/; revision=27544
Gonzalo Paniagua Javier 21 éve
szülő
commit
8e70fc3962

+ 4 - 0
mcs/class/System/System.Net/ChangeLog

@@ -1,3 +1,7 @@
+2004-05-18  Gonzalo Paniagua Javier <[email protected]>
+
+	* WebException.cs: implemented serialization .ctor and GetObjectData().
+
 2004-05-13  Gonzalo Paniagua Javier <[email protected]>
 
 	* WebAsyncResult.cs: don't create the WaitHandle if not needed.

+ 7 - 3
mcs/class/System/System.Net/WebException.cs

@@ -26,10 +26,12 @@ namespace System.Net
 		{
 		}
 
-		protected WebException (SerializationInfo serializationInfo,
-		   			StreamingContext streamingContext)
-			: base (serializationInfo, streamingContext)
+		protected WebException (SerializationInfo info,
+		   			StreamingContext context)
+			: base (info, context)
 		{
+			status = (WebExceptionStatus) info.GetInt32 ("web_status");
+			response = (WebResponse) info.GetValue ("web_response", typeof (WebResponse));
 		}
 
 		public WebException (string message, Exception innerException)
@@ -68,6 +70,8 @@ namespace System.Net
 		void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
 		{
 			base.GetObjectData (info, context);
+			info.AddValue ("web_status", (int) status, typeof (int));
+			info.AddValue ("web_response", response, typeof (WebResponse));
 		}
 	}
 }