- // \r
+// \r
// System.Web.HttpApplication\r
//\r
// Author:\r
// Patrik Torstensson (Patrik.Torstensson@labs2.com)\r
+// Tim Coleman (tim@timcoleman.com)\r
//\r
using System;\r
using System.ComponentModel;\r
+using System.Security.Principal;\r
using System.Web.SessionState;\r
\r
namespace System.Web {\r
- [MonoTODO()]\r
- public class HttpApplication : IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable {\r
- private bool _CompleteRequest;\r
+ [ToolboxItem (true)]\r
+ [MonoTODO()]\r
+ public class HttpApplication : IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable {\r
\r
- private HttpContext _Context;\r
- private HttpContext _OverrideContext;\r
- \r
- private bool _InPreRequestResponseMode;\r
-\r
- private ISite _Site;\r
- private HttpModuleCollection _ModuleCollection;\r
- private HttpSessionState _Session;\r
-\r
- public event EventHandler AcquireRequestState;\r
- public event EventHandler AuthenticateRequest;\r
- public event EventHandler AuthorizeRequest;\r
- public event EventHandler BeginRequest;\r
- public event EventHandler Disposed;\r
- public event EventHandler EndRequest;\r
- public event EventHandler Error;\r
- public event EventHandler PostRequestHandlerExecute;\r
- public event EventHandler PreRequestHandlerExecute;\r
- public event EventHandler PreSendRequestContent;\r
- public event EventHandler PreSendRequestHeaders;\r
- public event EventHandler ReleaseRequestState;\r
- public event EventHandler ResolveRequestCache;\r
- public event EventHandler UpdateRequestCache;\r
-\r
- [MonoTODO()]\r
- public HttpApplication() {\r
- // Init HTTP context and the methods from HttpRuntime....\r
- }\r
-\r
- internal void ClearError() {\r
- // Called from Server Utility\r
- }\r
-\r
- public HttpContext Context {\r
- get {\r
- if (null != _OverrideContext) {\r
- return _OverrideContext;\r
- }\r
-\r
- return _Context;\r
- }\r
- }\r
-\r
- public HttpModuleCollection Modules {\r
- get {\r
- if (null == _ModuleCollection) {\r
- _ModuleCollection = new HttpModuleCollection();\r
- }\r
-\r
- return _ModuleCollection;\r
- }\r
- }\r
-\r
- public HttpRequest Request {\r
- get {\r
- if (null != _Context && (!_InPreRequestResponseMode)) {\r
- return _Context.Request;\r
- }\r
-\r
- throw new HttpException("Cant get request object");\r
- }\r
- }\r
-\r
- public HttpResponse Response {\r
- get {\r
- if (null != _Context && (!_InPreRequestResponseMode)) {\r
- return _Context.Response;\r
- }\r
-\r
- throw new HttpException("Cant get response object");\r
- }\r
- }\r
-\r
- public HttpServerUtility Server {\r
- get {\r
- if (null != _Context) {\r
- return _Context.Server;\r
- }\r
-\r
- return new HttpServerUtility(this);\r
- }\r
- }\r
-\r
- public HttpSessionState Session {\r
- get {\r
- if (null != _Session) {\r
- return _Session;\r
- }\r
-\r
- if (null != _Context && null != _Context.Session) {\r
- return _Context.Session;\r
- }\r
-\r
- throw new HttpException("Failed to get session object");\r
- }\r
- }\r
-\r
- public virtual string GetVaryByCustomString(HttpContext context, string custom) {\r
- if (custom.ToLower() == "browser") {\r
- return context.Request.Browser.Type;\r
- }\r
-\r
- return string.Empty;\r
- }\r
-\r
- [MonoTODO()]\r
- IAsyncResult IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO()]\r
- void IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO()]\r
- void IHttpHandler.ProcessRequest(HttpContext context) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- bool IHttpHandler.IsReusable {\r
- get {\r
- throw new NotImplementedException();\r
- }\r
- }\r
-\r
- public ISite Site {\r
- get {\r
- return _Site;\r
- }\r
-\r
- set {\r
- _Site = value;\r
- }\r
- }\r
-\r
- public void CompleteRequest() {\r
- _CompleteRequest = true;\r
- }\r
-\r
- [MonoTODO("Cleanup")]\r
- public virtual void Dispose() {\r
+ #region Fields\r
+\r
+ bool _CompleteRequest;\r
+\r
+ HttpContext _Context;\r
+ HttpContext _OverrideContext;\r
\r
- }\r
+ bool _InPreRequestResponseMode;\r
+\r
+ ISite _Site;\r
+ HttpModuleCollection _ModuleCollection;\r
+ HttpSessionState _Session;\r
+ IPrincipal user;\r
+\r
+ #endregion // Fields\r
+\r
+ #region Constructors\r
+\r
+ [MonoTODO()]\r
+ public HttpApplication() \r
+ {\r
+ // Init HTTP context and the methods from HttpRuntime....\r
+ }\r
+\r
+ #endregion // Constructors\r
+\r
+ #region Properties\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpApplicationState Application {\r
+ [MonoTODO]\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpContext Context {\r
+ get {\r
+ if (null != _OverrideContext) \r
+ return _OverrideContext;\r
+ return _Context;\r
+ }\r
+ }\r
+\r
+ protected EventHandlerList Events {\r
+ [MonoTODO]\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+\r
+ bool IHttpHandler.IsReusable {\r
+ [MonoTODO]\r
+ get { throw new NotImplementedException(); }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpModuleCollection Modules {\r
+ get {\r
+ if (null == _ModuleCollection) \r
+ _ModuleCollection = new HttpModuleCollection();\r
+ return _ModuleCollection;\r
+ }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpRequest Request {\r
+ get {\r
+ if (null != _Context && (!_InPreRequestResponseMode)) \r
+ return _Context.Request;\r
+ throw new HttpException("Cant get request object");\r
+ }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpResponse Response {\r
+ get {\r
+ if (null != _Context && (!_InPreRequestResponseMode)) \r
+ return _Context.Response;\r
+ throw new HttpException("Cant get response object");\r
+ }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpServerUtility Server {\r
+ get {\r
+ if (null != _Context) \r
+ return _Context.Server;\r
+ return new HttpServerUtility(this);\r
+ }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public HttpSessionState Session {\r
+ get {\r
+ if (null != _Session) \r
+ return _Session;\r
+ if (null != _Context && null != _Context.Session) \r
+ return _Context.Session;\r
+ throw new HttpException("Failed to get session object");\r
+ }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public ISite Site {\r
+ get { return _Site; }\r
+ set { _Site = value; }\r
+ }\r
+\r
+ [Browsable (false)]\r
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
+ public IPrincipal User {\r
+ get { return user; }\r
+ [MonoTODO ("This requires the ControlPrincipal flag to be set in Flags.")]\r
+ set { user = value; }\r
+ }\r
+\r
+ #endregion Properties\r
+\r
+ #region Methods\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO ("Implementation required.")]\r
+ public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ internal void ClearError() \r
+ {\r
+ // Called from Server Utility\r
+ }\r
+\r
+ public void CompleteRequest () \r
+ {\r
+ _CompleteRequest = true;\r
+ }\r
+\r
+ [MonoTODO("Cleanup")]\r
+ public virtual void Dispose () \r
+ {\r
+ }\r
+\r
+ public virtual string GetVaryByCustomString (HttpContext context, string custom) \r
+ {\r
+ if (custom.ToLower() == "browser") \r
+ return context.Request.Browser.Type;\r
+ return string.Empty;\r
+ }\r
+\r
+ [MonoTODO()]\r
+ IAsyncResult IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) \r
+ {\r
+ throw new NotImplementedException();\r
+ }\r
+\r
+ [MonoTODO()]\r
+ void IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) \r
+ {\r
+ throw new NotImplementedException();\r
+ }\r
+\r
+ [MonoTODO()]\r
+ void IHttpHandler.ProcessRequest(HttpContext context) \r
+ {\r
+ throw new NotImplementedException();\r
+ }\r
+\r
+ public virtual void Init() \r
+ {\r
+ }\r
+\r
+ #endregion // Methods\r
+\r
+ #region Events and Delegates\r
+\r
+ public event EventHandler AcquireRequestState;\r
+ public event EventHandler AuthenticateRequest;\r
+ public event EventHandler AuthorizeRequest;\r
+ public event EventHandler BeginRequest;\r
+ public event EventHandler Disposed;\r
+ public event EventHandler EndRequest;\r
+ public event EventHandler Error;\r
+ public event EventHandler PostRequestHandlerExecute;\r
+ public event EventHandler PreRequestHandlerExecute;\r
+ public event EventHandler PreSendRequestContent;\r
+ public event EventHandler PreSendRequestHeaders;\r
+ public event EventHandler ReleaseRequestState;\r
+ public event EventHandler ResolveRequestCache;\r
+ public event EventHandler UpdateRequestCache;\r
\r
- public virtual void Init() {\r
- }\r
- }\r
+ #endregion // Events and Delegates\r
+ }\r
}\r