ソースを参照

2010-01-20 Marek Habersack <[email protected]>

	* SessionStateBehavior.cs: added (4.0)

2010-01-20  Marek Habersack  <[email protected]>

	* OutputCacheSection.cs: implemented the Providers and
	DefaultProviderName 4.0 properties.

2010-01-20  Marek Habersack  <[email protected]>

	* HttpContextBase.cs: implemented RemapHandler and
	SetSessionStateBehavior 4.0 APIs.

2010-01-20  Marek Habersack  <[email protected]>

	* HttpContext.cs: implemented the 4.0 SetSessionStateBehavior
	method

	* HttpCacheVaryByContentEncodings.cs, HttpCacheVaryByHeaders.cs,
	HttpCacheVaryByParams.cs : parameterless constructors are public
	in 4.0

	* HttpApplication.cs: implemented the 4.0
	GetOutputCacheProviderName method

svn path=/trunk/mcs/; revision=149934
Marek Habersack 16 年 前
コミット
38f8d2d40c

+ 5 - 0
mcs/class/System.Web.Abstractions/System.Web/ChangeLog

@@ -1,3 +1,8 @@
+2010-01-20  Marek Habersack  <[email protected]>
+
+	* HttpContextBase.cs: implemented RemapHandler and
+	SetSessionStateBehavior 4.0 APIs.
+
 2009-07-30 Gonzalo Paniagua Javier <[email protected]>
 
 	* HttpResponseWrapper.cs: removed a few TODO/NotImplemented.

+ 13 - 1
mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs

@@ -36,6 +36,7 @@ using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 using System.Web.Profile;
+using System.Web.SessionState;
 
 namespace System.Web
 {
@@ -140,7 +141,12 @@ namespace System.Web
 			NotImplemented ();
 			return null;
 		}
-
+#if NET_4_0
+		public virtual void RemapHandler (IHttpHandler handler)
+		{
+			NotImplemented ();
+		}
+#endif
 		public virtual void RewritePath (string path)
 		{
 			NotImplemented ();
@@ -160,5 +166,11 @@ namespace System.Web
 		{
 			NotImplemented ();
 		}
+#if NET_4_0
+		public virtual void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
+		{
+			NotImplemented ();
+		}
+#endif
 	}
 }

+ 5 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog

@@ -1,3 +1,8 @@
+2010-01-20  Marek Habersack  <[email protected]>
+
+	* OutputCacheSection.cs: implemented the Providers and
+	DefaultProviderName 4.0 properties.
+
 2010-01-09  Marek Habersack  <[email protected]>
 
 	* WebConfigurationManager.cs: GetSection properly handles looking

+ 30 - 7
mcs/class/System.Web/System.Web.Configuration_2.0/OutputCacheSection.cs

@@ -4,7 +4,7 @@
 // Authors:
 //	Chris Toshok ([email protected])
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -31,9 +31,8 @@
 using System;
 using System.Configuration;
 
-#if NET_2_0
-
-namespace System.Web.Configuration {
+namespace System.Web.Configuration
+{
 
 	public sealed class OutputCacheSection : ConfigurationSection
 	{
@@ -42,6 +41,10 @@ namespace System.Web.Configuration {
 		static ConfigurationProperty omitVaryStarProp;
 		static ConfigurationProperty sendCacheControlHeaderProp;
 		static ConfigurationProperty enableKernelCacheForVaryByStarProp;
+#if NET_4_0
+		static ConfigurationProperty providersProp;
+		static ConfigurationProperty defaultProviderNameProp;
+#endif
 		
 		static ConfigurationPropertyCollection properties;
 
@@ -51,8 +54,11 @@ namespace System.Web.Configuration {
 			enableOutputCacheProp = new ConfigurationProperty ("enableOutputCache", typeof (bool), true);
 			omitVaryStarProp = new ConfigurationProperty ("omitVaryStar", typeof (bool), false);
 			sendCacheControlHeaderProp = new ConfigurationProperty ("sendCacheControlHeader", typeof (bool), true);
-			enableKernelCacheForVaryByStarProp = new ConfigurationProperty ("enableKernelCacheForVaryByStar",
-											typeof (bool), false);
+			enableKernelCacheForVaryByStarProp = new ConfigurationProperty ("enableKernelCacheForVaryByStar", typeof (bool), false);
+#if NET_4_0
+			providersProp = new ConfigurationProperty ("providers", typeof (ProviderSettingsCollection));
+			defaultProviderNameProp = new ConfigurationProperty ("defaultProvider", typeof (string), "AspNetInternalProvider");
+#endif
 			
 			properties = new ConfigurationPropertyCollection ();
 
@@ -61,6 +67,10 @@ namespace System.Web.Configuration {
 			properties.Add (omitVaryStarProp);
 			properties.Add (sendCacheControlHeaderProp);
 			properties.Add (enableKernelCacheForVaryByStarProp);
+#if NET_4_0
+			properties.Add (providersProp);
+			properties.Add (defaultProviderNameProp);
+#endif
 		}
 
 		[ConfigurationProperty ("enableFragmentCache", DefaultValue = "True")]
@@ -93,6 +103,20 @@ namespace System.Web.Configuration {
 			set { base[sendCacheControlHeaderProp] = value; }
 		}
 
+#if NET_4_0
+		[StringValidatorAttribute(MinLength = 1)]
+		[ConfigurationPropertyAttribute("defaultProvider", DefaultValue = "AspNetInternalProvider")]
+		public string DefaultProviderName {
+			get { return base [defaultProviderNameProp] as string; }
+			set { base [defaultProviderNameProp] = value; }
+		}
+		
+		[ConfigurationPropertyAttribute("providers")]
+		public ProviderSettingsCollection Providers {
+			get { return base [providersProp] as ProviderSettingsCollection; }
+		}
+#endif
+		
 		protected override ConfigurationPropertyCollection Properties {
 			get { return properties; }
 		}
@@ -101,5 +125,4 @@ namespace System.Web.Configuration {
 
 }
 
-#endif
 

+ 4 - 0
mcs/class/System.Web/System.Web.SessionState_2.0/ChangeLog

@@ -1,3 +1,7 @@
+2010-01-20  Marek Habersack  <[email protected]>
+
+	* SessionStateBehavior.cs: added (4.0)
+
 2009-10-19  Marek Habersack  <[email protected]>
 
 	* SessionStateModule.cs: enabled SQL session state provider.

+ 40 - 0
mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateBehavior.cs

@@ -0,0 +1,40 @@
+//
+//
+// Authors:
+//      Marek Habersack <[email protected]>
+//
+
+//
+// Copyright (C) 2010 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
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace System.Web.SessionState
+{
+	public enum SessionStateBehavior
+	{
+		Default,
+		Required,
+		ReadOnly,
+		Disabled
+	}
+}

+ 12 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,15 @@
+2010-01-20  Marek Habersack  <[email protected]>
+
+	* HttpContext.cs: implemented the 4.0 SetSessionStateBehavior
+	method
+
+	* HttpCacheVaryByContentEncodings.cs, HttpCacheVaryByHeaders.cs,
+	HttpCacheVaryByParams.cs : parameterless constructors are public
+	in 4.0
+
+	* HttpApplication.cs: implemented the 4.0
+	GetOutputCacheProviderName method
+
 2010-01-19  Marek Habersack  <[email protected]>
 
 	* StaticSiteMapProvider.cs: AddNode checks the url of node

+ 9 - 0
mcs/class/System.Web/System.Web/HttpApplication.cs

@@ -830,6 +830,15 @@ namespace System.Web
 		{
 		}
 
+#if NET_4_0
+		public virtual string GetOutputCacheProviderName (HttpContext context)
+		{
+			var ocs = WebConfigurationManager.GetWebApplicationSection ("system.web/caching/outputCache") as OutputCacheSection;
+
+			return ocs.DefaultProviderName;
+		}
+#endif
+		
 		public virtual string GetVaryByCustomString (HttpContext context, string custom)
 		{
 			if (custom == null) // Sigh

+ 6 - 1
mcs/class/System.Web/System.Web/HttpCacheVaryByContentEncodings.cs

@@ -38,7 +38,12 @@ namespace System.Web
 	{
 		Dictionary <string, bool> encodings;
 
-		internal HttpCacheVaryByContentEncodings ()
+#if NET_4_0
+		public
+#else
+		internal
+#endif
+		HttpCacheVaryByContentEncodings ()
 		{
 			encodings = new Dictionary <string, bool> ();
 		}

+ 6 - 1
mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs

@@ -66,7 +66,12 @@ namespace System.Web
 
 		Hashtable fields;
 
-		internal HttpCacheVaryByHeaders ()
+#if NET_4_0
+		public
+#else
+		internal
+#endif
+		HttpCacheVaryByHeaders ()
 		{
 			/* the field names are meant to be case insensitive */
 			fields = new Hashtable (StringComparer.InvariantCultureIgnoreCase);

+ 6 - 1
mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs

@@ -42,7 +42,12 @@ namespace System.Web
 		bool ignore_parms;
 		Hashtable parms;
 
-		internal HttpCacheVaryByParams ()
+#if NET_4_0
+		public
+#else
+		internal
+#endif
+		HttpCacheVaryByParams ()
 		{
 			/* the parameter names are meant to be case insensitive */
 			parms = new Hashtable (StringComparer.InvariantCultureIgnoreCase);

+ 17 - 3
mcs/class/System.Web/System.Web/HttpContext.cs

@@ -75,7 +75,7 @@ namespace System.Web
 		Timer timer;
 		Thread thread;
 		bool _isProcessingInclude;
-
+		
 		[ThreadStatic]
 		static ResourceProviderFactory provider_factory;
 
@@ -110,13 +110,14 @@ namespace System.Web
 			WorkerRequest = wr;
 			request = new HttpRequest (WorkerRequest, this);
 			response = new HttpResponse (WorkerRequest, this);
+			SessionStateBehavior = SessionStateBehavior.Default;
 		}
 
 		public HttpContext (HttpRequest request, HttpResponse response)
 		{
 			this.request = request;
 			this.response = response;
-			
+			SessionStateBehavior = SessionStateBehavior.Default;
 		}
 
 		internal bool IsProcessingInclude {
@@ -646,8 +647,14 @@ namespace System.Web
 				req.QueryStringRaw = queryString;
 		}
 
-#region internals
+#if NET_4_0
+		public void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
+		{
+			SessionStateBehavior = sessionStateBehavior;
+		}
+#endif
 		
+#region internals
 		internal void SetSession (HttpSessionState state)
 		{
 			session_state = state;
@@ -691,6 +698,13 @@ namespace System.Web
 			}
 		}
 
+#if NET_4_0
+		internal SessionStateBehavior SessionStateBehavior {
+			get;
+			private set;
+		}
+#endif
+		
 #if !TARGET_J2EE
 		void TimeoutReached(object state) {
 			HttpRuntime.QueuePendingRequest (false);

+ 2 - 0
mcs/class/System.Web/System.Web/IPartitionResolver.cs

@@ -31,8 +31,10 @@ using System.Security.Permissions;
 
 namespace System.Web
 {
+#if !NET_4_0
 	[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),
 	AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#endif
 	public interface IPartitionResolver
 	{
 		void Initialize ();

+ 1 - 0
mcs/class/System.Web/net_4_0_System.Web.dll.sources

@@ -3,6 +3,7 @@
 System.Web/IHtmlString.cs
 System.Web/HtmlString.cs
 
+System.Web.SessionState_2.0/SessionStateBehavior.cs
 System.Web.Routing/PageRouteHandler.cs
 System.Web.UI.WebControls/IDataBoundControl.cs
 System.Web.UI.WebControls/IDataBoundItemControl.cs