do not check order sequence if option /order was not used
[mono.git] / mcs / class / System.Web.Abstractions / System.Web / HttpContextWrapper.cs
1 //
2 // HttpContextWrapper.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2008-2010 Novell Inc. http://novell.com
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 using System;
31 using System.Collections;
32 using System.Collections.Generic;
33 using System.Globalization;
34 using System.Runtime.CompilerServices;
35 using System.Security.Permissions;
36 using System.Security.Principal;
37 using System.Web.Caching;
38 using System.Web.Profile;
39 using System.Web.SessionState;
40
41 namespace System.Web
42 {
43 #if NET_4_0
44         [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
45 #endif
46         [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
47         [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
48         public class HttpContextWrapper : HttpContextBase
49         {
50                 HttpContext w;
51
52                 public HttpContextWrapper (HttpContext httpContext)
53                 {
54                         if (httpContext == null)
55                                 throw new ArgumentNullException ("httpContext");
56                         w = httpContext;
57                 }
58
59                 public override Exception [] AllErrors {
60                         get { return w.AllErrors; }
61                 }
62
63                 public override HttpApplicationStateBase Application {
64                         get { return new HttpApplicationStateWrapper (w.Application); }
65                 }
66
67                 public override HttpApplication ApplicationInstance {
68                         get { return w.ApplicationInstance; }
69                         set { w.ApplicationInstance = value; }
70                 }
71
72                 public override Cache Cache {
73                         get { return w.Cache; }
74                 }
75
76                 public override IHttpHandler CurrentHandler {
77                         get { return w.CurrentHandler; }
78                 }
79
80                 public override RequestNotification CurrentNotification {
81                         get { return w.CurrentNotification; }
82                 }
83
84                 public override Exception Error {
85                         get { return w.Error; }
86                 }
87
88                 public override IHttpHandler Handler {
89                         get { return w.Handler; }
90                         set { w.Handler = value; }
91                 }
92
93                 public override bool IsCustomErrorEnabled {
94                         get { return w.IsCustomErrorEnabled; }
95                 }
96
97                 public override bool IsDebuggingEnabled {
98                         get { return w.IsDebuggingEnabled; }
99                 }
100
101                 public override bool IsPostNotification {
102                         get { return w.IsPostNotification; }
103                 }
104
105                 public override IDictionary Items {
106                         get { return w.Items; }
107                 }
108
109                 public override IHttpHandler PreviousHandler {
110                         get { return w.PreviousHandler; }
111                 }
112
113                 public override ProfileBase Profile {
114                         get { return w.Profile; }
115                 }
116
117                 public override HttpRequestBase Request {
118                         get { return new HttpRequestWrapper (w.Request); }
119                 }
120
121                 public override HttpResponseBase Response {
122                         get { return new HttpResponseWrapper (w.Response); }
123                 }
124
125                 public override HttpServerUtilityBase Server {
126                         get { return new HttpServerUtilityWrapper (w.Server); }
127                 }
128
129                 public override HttpSessionStateBase Session {
130                         get { return new HttpSessionStateWrapper (w.Session); }
131                 }
132
133                 public override bool SkipAuthorization {
134                         get { return w.SkipAuthorization; }
135                         set { w.SkipAuthorization = value; }
136                 }
137
138                 public override DateTime Timestamp {
139                         get { return w.Timestamp; }
140                 }
141
142                 public override TraceContext Trace {
143                         get { return w.Trace; }
144                 }
145
146                 public override IPrincipal User {
147                         get { return w.User; }
148                         set { w.User = value; }
149                 }
150
151                 public override void AddError (Exception errorInfo)
152                 {
153                         w.AddError (errorInfo);
154                 }
155
156                 public override void ClearError ()
157                 {
158                         w.ClearError ();
159                 }
160
161                 public override object GetGlobalResourceObject (string classKey, string resourceKey)
162                 {
163                         return HttpContext.GetGlobalResourceObject (classKey, resourceKey);
164                 }
165
166                 public override object GetGlobalResourceObject (string classKey, string resourceKey, CultureInfo culture)
167                 {
168                         return HttpContext.GetGlobalResourceObject (classKey, resourceKey, culture);
169                 }
170
171                 public override object GetLocalResourceObject (string overridePath, string resourceKey)
172                 {
173                         return HttpContext.GetLocalResourceObject (overridePath, resourceKey);
174                 }
175
176                 public override object GetLocalResourceObject (string overridePath, string resourceKey, CultureInfo culture)
177                 {
178                         return HttpContext.GetLocalResourceObject (overridePath, resourceKey, culture);
179                 }
180
181                 public override object GetSection (string sectionName)
182                 {
183                         return w.GetSection (sectionName);
184                 }
185
186                 [MonoTODO]
187                 public override object GetService (Type serviceType)
188                 {
189                         throw new NotImplementedException ();
190                 }
191 #if NET_4_0
192                 public override void RemapHandler (IHttpHandler handler)
193                 {
194                         w.RemapHandler (handler);
195                 }
196 #endif
197                 public override void RewritePath (string path)
198                 {
199                         w.RewritePath (path);
200                 }
201
202                 public override void RewritePath (string path, bool rebaseClientPath)
203                 {
204                         w.RewritePath (path, rebaseClientPath);
205                 }
206
207                 public override void RewritePath (string filePath, string pathInfo, string queryString)
208                 {
209                         w.RewritePath (filePath, pathInfo, queryString);
210                 }
211
212                 public override void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
213                 {
214                         w.RewritePath (filePath, pathInfo, queryString, setClientFilePath);
215                 }
216 #if NET_4_0
217                 public override void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
218                 {
219                         w.SetSessionStateBehavior (sessionStateBehavior);
220                 }
221 #endif
222         }
223 }