浏览代码

2005-01-19 Sebastien Pouliot <[email protected]>

	* WebPermissionAttribute.cs: Fixed NET_1_1 behaviour.


svn path=/trunk/mcs/; revision=39162
Sebastien Pouliot 21 年之前
父节点
当前提交
696d657cbb
共有 2 个文件被更改,包括 23 次插入3 次删除
  1. 4 0
      mcs/class/System/System.Net/ChangeLog
  2. 19 3
      mcs/class/System/System.Net/WebPermissionAttribute.cs

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

@@ -1,3 +1,7 @@
+2005-01-19  Sebastien Pouliot  <[email protected]>
+
+	* WebPermissionAttribute.cs: Fixed NET_1_1 behaviour.
+
 2004-12-14 Gonzalo Paniagua Javier <[email protected]>
 
 	* WebConnectionStream.cs: remove unneeded check. Write detects and

+ 19 - 3
mcs/class/System/System.Net/WebPermissionAttribute.cs

@@ -6,7 +6,7 @@
 //	Sebastien Pouliot  <[email protected]>
 //
 // (C) 2003 Andreas Nahr
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 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
@@ -53,15 +53,23 @@ namespace System.Net {
 
 		public string Accept {
 			get {
+#if NET_2_0
 				if (m_accept == null)
 					return null;
+#endif
 				return (m_accept as WebPermissionInfo).Info; 
 			}
 			set { 
 				if (m_accept != null)
 					AlreadySet ("Accept", "Accept");
-
+#if NET_2_0
 				m_accept = new WebPermissionInfo (WebPermissionInfoType.InfoString, value);
+#else
+				if (value == null)
+					m_accept = null;
+				else
+					m_accept = new WebPermissionInfo (WebPermissionInfoType.InfoString, value);
+#endif
 			}
 		}
 
@@ -83,15 +91,23 @@ namespace System.Net {
 
 		public string Connect {
 			get {
+#if NET_2_0
 				if (m_connect == null)
 					return null;
+#endif
 				return (m_connect as WebPermissionInfo).Info; 
 			}
 			set { 
 				if (m_connect != null)
 					AlreadySet ("Connect", "Connect");
-
+#if NET_2_0
 				m_connect = new WebPermissionInfo (WebPermissionInfoType.InfoString, value);
+#else
+				if (value == null)
+					m_connect = null;
+				else
+					m_connect = new WebPermissionInfo (WebPermissionInfoType.InfoString, value);
+#endif
 			}
 		}