2010-05-05 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Fri, 7 May 2010 23:02:05 +0000 (23:02 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 7 May 2010 23:02:05 +0000 (23:02 -0000)
* HttpRequest.cs: implemented new 4.0 property - RequestContext

svn path=/trunk/mcs/; revision=156929

mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpRequest.cs

index c4c60cb7831262678b4f55cadda07ae9438ef9cf..3398ab7dedbf47ffd48936fd55b5456bf3626411 100644 (file)
@@ -1,3 +1,7 @@
+2010-05-05  Marek Habersack  <mhabersack@novell.com>
+
+       * HttpRequest.cs: implemented new 4.0 property - RequestContext
+
 2010-04-29  Marek Habersack  <mhabersack@novell.com>
 
        * HttpRequest.cs: added 4.0 InsertEntityBody overloads (not
index ee6e58eddb6cedc7ec60da14e386b55f6ef205cd..efb21ad63d942ade436bee69f151e24e0bb16ed4 100644 (file)
@@ -46,6 +46,7 @@ using System.Globalization;
 
 #if NET_4_0
 using System.Security.Authentication.ExtendedProtection;
+using System.Web.Routing;
 #endif
 
 namespace System.Web
@@ -107,6 +108,8 @@ namespace System.Web
                static readonly UrlMappingCollection urlMappings;
                readonly static char [] queryTrimChars = {'?'};
 #if NET_4_0
+               RequestContext requestContext;
+               
                static bool validateRequestNewMode;
                internal static bool ValidateRequestNewMode {
                        get { return validateRequestNewMode; }
@@ -926,6 +929,17 @@ namespace System.Web
                        }
                }
 #if NET_4_0
+               public RequestContext RequestContext {
+                       get {
+                               if (requestContext == null)
+                                       requestContext = new RequestContext (new HttpContextWrapper (this.context ?? HttpContext.Current), new RouteData ());
+
+                               return requestContext;
+                       }
+                       
+                       internal set { requestContext = value; }        
+               }
+
                public ChannelBinding HttpChannelBinding {
                        get {
                                throw new PlatformNotSupportedException ("This property is not supported.");