Welcome to mirror list, hosted at ThFree Co, Russian Federation.

HttpApplication.cs « System.Web « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21a20a1c1d6d621cc0e931949f9a0e0b5cbe57e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
   // 
// System.Web.HttpApplication
//
// Author:
//   Patrik Torstensson (Patrik.Torstensson@labs2.com)
//
using System;
using System.ComponentModel;

namespace System.Web {
   [MonoTODO()]
   public class HttpApplication : IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable {
      private bool _CompleteRequest;

      private HttpContext _Context;
      private HttpContext _OverrideContext;
         
      private bool _InPreRequestResponseMode;

      private ISite _Site;
      private HttpModuleCollection _ModuleCollection;
      private HttpSessionState _Session;

      public event EventHandler AcquireRequestState;
      public event EventHandler AuthenticateRequest;
      public event EventHandler AuthorizeRequest;
      public event EventHandler BeginRequest;
      public event EventHandler Disposed;
      public event EventHandler EndRequest;
      public event EventHandler Error;
      public event EventHandler PostRequestHandlerExecute;
      public event EventHandler PreRequestHandlerExecute;
      public event EventHandler PreSendRequestContent;
      public event EventHandler PreSendRequestHeaders;
      public event EventHandler ReleaseRequestState;
      public event EventHandler ResolveRequestCache;
      public event EventHandler UpdateRequestCache;

      [MonoTODO()]
      public HttpApplication() {
         // Init HTTP context and the methods from HttpRuntime....
      }

      internal void ClearError() {
         // Called from Server Utility
      }

      public HttpContext Context {
         get {
            if (null != _OverrideContext) {
               return _OverrideContext;
            }

            return _Context;
         }
      }

      public HttpModuleCollection Modules {
         get {
            if (null == _ModuleCollection) {
               _ModuleCollection = new HttpModuleCollection();
            }

            return _ModuleCollection;
         }
      }

      public HttpRequest Request {
         get {
            if (null != _Context && (!_InPreRequestResponseMode)) {
               return _Context.Request;
            }

            throw new HttpException("Cant get request object");
         }
      }

      public HttpResponse Response {
         get {
            if (null != _Context && (!_InPreRequestResponseMode)) {
               return _Context.Response;
            }

            throw new HttpException("Cant get response object");
         }
      }

      public HttpServerUtility Server {
         get {
            if (null != _Context) {
               return _Context.Server;
            }

            return new HttpServerUtility(this);
         }
      }

      public HttpSessionState Session {
         get {
            if (null != _Session) {
               return _Session;
            }

            if (null != _Context && null != _Context.Session) {
               return _Context.Session;
            }

            throw new HttpException("Failed to get session object");
         }
      }

      public virtual string GetVaryByCustomString(HttpContext context, string custom) {
         if (custom.ToLower() == "browser") {
            return context.Request.Browser.Type;
         }

         return string.Empty;
      }

      [MonoTODO()]
      IAsyncResult IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) {
         throw new NotImplementedException();
      }

      [MonoTODO()]
      void IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) {
         throw new NotImplementedException();
      }

      [MonoTODO()]
      void IHttpHandler.ProcessRequest(HttpContext context) {
         throw new NotImplementedException();
      }

      bool IHttpHandler.IsReusable {
         get {
            throw new NotImplementedException();
         }
      }

      public ISite Site {
         get {
            return _Site;
         }

         set {
            _Site = value;
         }
      }

      public void CompleteRequest() {
         _CompleteRequest = true;
      }

      [MonoTODO("Cleanup")]
      public virtual void Dispose() {
         
      }

      public virtual void Init() {
      }
   }
}