Browse Source

2007-12-12 Marek Habersack <[email protected]>

	* WebClient.cs: DownloadProgressChanged is available only in the
	2.0+ profiles

svn path=/trunk/mcs/; revision=91152
Marek Habersack 18 years ago
parent
commit
f3422a1f2b
2 changed files with 9 additions and 0 deletions
  1. 5 0
      mcs/class/System/System.Net/ChangeLog
  2. 4 0
      mcs/class/System/System.Net/WebClient.cs

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

@@ -1,3 +1,8 @@
+2007-12-12  Marek Habersack  <[email protected]>
+
+	* WebClient.cs: DownloadProgressChanged is available only in the
+	2.0+ profiles.
+
 2007-12-12  Miguel de Icaza  <[email protected]>
 
 	* WebClient.cs (DownloadFileCore): use longs for the

+ 4 - 0
mcs/class/System/System.Net/WebClient.cs

@@ -308,6 +308,7 @@ namespace System.Net
 					int nread = 0;
 					long notify_total = 0;
 					while ((nread = st.Read (buffer, 0, length)) != 0){
+#if NET_2_0
 						if (async && DownloadProgressChanged != null){
 							notify_total += nread;
 							DownloadProgressChanged (
@@ -315,6 +316,7 @@ namespace System.Net
 								new DownloadProgressChangedEventArgs (response.ContentLength, notify_total, userToken));
 												      
 						}
+#endif
 						f.Write (buffer, 0, nread);
 					}
 				} catch (ThreadInterruptedException){
@@ -928,10 +930,12 @@ namespace System.Net
 					offset += nread;
 					size -= nread;
 				}
+#if NET_2_0
 				if (async && DownloadProgressChanged != null){
 					total += nread;
 					DownloadProgressChanged (this, new DownloadProgressChangedEventArgs (nread, length, userToken));
 				}
+#endif
 			}
 
 			if (nolength)