فهرست منبع

2006-01-04 Chris Toshok <[email protected]>

	* WebServiceProtocols.cs: use 1 << n instead of explicit numbers.

	* WebServicesSection.cs (Instance): new property to make it easier
	to port over the existing configuration code.
	(IsSupported): new method, same rationale.


svn path=/trunk/mcs/; revision=55080
Chris Toshok 20 سال پیش
والد
کامیت
dfdc9f5160

+ 8 - 0
mcs/class/System.Web.Services/System.Web.Services.Configuration/ChangeLog

@@ -1,3 +1,11 @@
+2006-01-04  Chris Toshok  <[email protected]>
+
+	* WebServiceProtocols.cs: use 1 << n instead of explicit numbers.
+
+	* WebServicesSection.cs (Instance): new property to make it easier
+	to port over the existing configuration code.
+	(IsSupported): new method, same rationale.
+
 2006-01-03  Chris Toshok  <[email protected]>
 
 	* DiagnosticsElement.cs: new implementation.

+ 5 - 5
mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServiceProtocols.cs

@@ -36,11 +36,11 @@ namespace System.Web.Services.Configuration {
 	public enum WebServiceProtocols {
 		Unknown = 0,
 		HttpSoap = 1,
-		HttpGet = 2,
-		HttpPost = 4,
-		Documentation = 8,
-		HttpPostLocalhost = 16,
-		HttpSoap12 = 32,
+		HttpGet = 1 << 1,
+		HttpPost = 1 << 2,
+		Documentation = 1 << 3,
+		HttpPostLocalhost = 1 << 4,
+		HttpSoap12 = 1 << 5,
 		AnyHttpSoap = HttpSoap | HttpSoap12
 	}
 }

+ 9 - 1
mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesSection.cs

@@ -32,10 +32,10 @@
 
 using System;
 using System.Configuration;
+using System.Web.Configuration;
 
 namespace System.Web.Services.Configuration
 {
-
         public sealed class WebServicesSection : ConfigurationSection
         {
                 static ConfigurationProperty conformanceWarningsProp;
@@ -162,6 +162,14 @@ namespace System.Web.Services.Configuration
                         get { return properties; }
                 }
 
+		internal static WebServicesSection Instance {
+			get { return (WebServicesSection)WebConfigurationManager.GetWebApplicationSection ("system.web/webServices"); }
+		}
+
+		internal static bool IsSupported (WebServiceProtocols proto)
+		{
+			return ((Instance.EnabledProtocols & proto) == proto && (proto != 0));
+		}
         }
 
 }