2002-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Mon, 19 Aug 2002 01:31:11 +0000 (01:31 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Mon, 19 Aug 2002 01:31:11 +0000 (01:31 -0000)
* System.Web/HttpContext.cs: reformatted.
* System.Web/HttpStaticObjectsCollection.cs: implemented GetEnumertor,
CopyTo and the indexer.
* System.Web.Compilation/PageCompiler.cs: fixed compilation.
* System.Web.SessionState/HttpSessionState.cs: IsAbandoned is internal.
* System.Web.SessionState/SessionDictionary.cs: scope fixes.
* System.Web.SessionState/SessionStateModule.cs: added events.

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

mcs/class/System.Web/System.Web.Compilation/ChangeLog
mcs/class/System.Web/System.Web.Compilation/PageCompiler.cs
mcs/class/System.Web/System.Web.SessionState/ChangeLog
mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs
mcs/class/System.Web/System.Web.SessionState/SessionDictionary.cs
mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs
mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpContext.cs
mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs

index 0f6c713f64a9b61bf50c9b951ad0897c90bd9965..64ffd0d836e281e381b34923a29c3662ac76d42e 100644 (file)
@@ -1,3 +1,7 @@
+2002-08-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * PageCompiler.cs: fixed compilation.
+
 2002-08-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * PageCompiler.cs: generate C# file using AspGenerator.
index 0028dffd68c353751e13fc1c4ced4c71867c2044..7c990231eba0944c9e299639b1cf464de5ede30a 100644 (file)
@@ -7,6 +7,7 @@
 // (C) 2002 Ximian, Inc (http://www.ximian.com)
 //
 using System;
+using System.IO;
 using System.Web.UI;
 
 namespace System.Web.Compilation
@@ -30,14 +31,14 @@ namespace System.Web.Compilation
                {
                        Stream input = File.OpenRead (inputFile);
                        AspParser parser = new AspParser (inputFile, input);
-                       parser.parse ();
-                       AspGenerator generator = new Generator (args [i], parser.Elements);
+                       parser.Parse ();
+                       AspGenerator generator = new AspGenerator (inputFile, parser.Elements);
                        //FIXME: set properties here -> base type, interfaces,...
                        generator.ProcessElements ();
                        string code = generator.GetCode ().ReadToEnd ();
                        //FIXME: should get Tmp dir for this application
                        string csName = Path.GetTempFileName ();
-                       StreamWriter output = File.OpenWrite (csName);
+                       StreamWriter output = new StreamWriter (File.OpenWrite (csName));
                        output.Write (code);
                        output.Close ();
                        return csName;
index a34f93c7f6ab8025322359dd3c612f2a90836976..7376c29e79987e89e72d58c7808188c5a55f10e7 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * HttpSessionState.cs: IsAbandoned is internal.
+       * SessionDictionary.cs: scope fixes.
+       * SessionStateModule.cs: added events.
+
 2002-06-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * System.Web.SessionState/HttpSessionState.cs: 
index ed90f6bc0a0d3ea30174850dc86ada34bb0de2e2..324470a97cccc3ff9abc2da32d5c7f9810c28e1b 100644 (file)
@@ -62,7 +62,7 @@ public sealed class HttpSessionState : ICollection, IEnumerable
                get { return _state.Count; }
        }
 
-       public bool IsAbandoned
+       internal bool IsAbandoned
        {
                get { return _abandoned; }
        }
index 8689d001da9860dc6bd6edf782b8c93b261b6943..a389125e1ddc59889debdbbd2fb2f20cb0fb4aca 100644 (file)
@@ -70,7 +70,7 @@ internal class SessionDictionary : NameObjectCollectionBase
                set { _dirty = value; }
        }
 
-       object this [string s]
+       internal object this [string s]
        {
                get { return BaseGet (s); }
                set {
@@ -79,7 +79,7 @@ internal class SessionDictionary : NameObjectCollectionBase
                }
        }
 
-       object this [int index]
+       public object this [int index]
        {
                get { return BaseGet (index); }
                set {
index da2654b5089aadf205d43da379c518798084d5f1..05cde3224f41b6aca6c42baf88314bc461e6df54 100644 (file)
@@ -8,24 +8,28 @@
 //\r
 using System.Web;\r
 \r
-namespace System.Web.SessionState {\r
-public sealed class SessionStateModule : IHttpModule\r
+namespace System.Web.SessionState\r
 {\r
-       public SessionStateModule ()\r
+       public sealed class SessionStateModule : IHttpModule\r
        {\r
-       }\r
+               public SessionStateModule ()\r
+               {\r
+               }\r
 \r
-       [MonoTODO()]\r
-       public void Dispose ()\r
-       {\r
-               throw new NotImplementedException ();\r
-       }\r
+               [MonoTODO()]\r
+               public void Dispose ()\r
+               {\r
+                       throw new NotImplementedException ();\r
+               }\r
 \r
-       [MonoTODO()]\r
-       public void Init (HttpApplication app)\r
-       {\r
-               throw new NotImplementedException ();\r
+               [MonoTODO()]\r
+               public void Init (HttpApplication app)\r
+               {\r
+                       throw new NotImplementedException ();\r
+               }\r
+\r
+               public event EventHandler Start;\r
+               public event EventHandler End;\r
        }\r
 }\r
-}\r
 \r
index 7249c619284d72b8e60ff3a708b4f7751549e5de..6d65b9c5a06da6d0437ab74f7fbb592f301e6fc8 100644 (file)
@@ -1,18 +1,26 @@
+2002-08-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * HttpContext.cs: reformatted.
+       * HttpStaticObjectsCollection.cs: implemented GetEnumertor, CopyTo and
+       the indexer.
+
 2002-08-05  Patrik Torstensson <ptorsten@hotmail.com>
 
-       * HttpApplication.cs: Implemented a state machine to allow handling of HttpModules 
-                                                                and HttpHandlers. Implementation of async handlers. 
+       * HttpApplication.cs: Implemented a state machine to allow handling of
+       HttpModules and HttpHandlers. Implementation of async handlers. 
                                                                 
-       * HttpApplicationFactory.cs: Factory for creating HttpApplication instances, including caching.
+       * HttpApplicationFactory.cs: Factory for creating HttpApplication
+       instances, including caching.
        
-       * HttpRuntime.cs: Usage of the new HttpApplicationFactory to get a application instance to
-                                                        execute requests in and implementation of request execution (still no request queue). 
+       * HttpRuntime.cs: Usage of the new HttpApplicationFactory to get a
+       application instance to execute requests in and implementation of 
+       request execution (still no request queue). 
                                                         
        * HttpAsyncResult.cs: New file to handle async module results.                                          
                                                         
        * HttpRequest.cs: Change signature of Dispose
-       * HttpResponse.cs: new internal method allowing filtering to happen during the request flow in the 
-                                                  state machine.
+       * HttpResponse.cs: new internal method allowing filtering to happen
+       during the request flow in the state machine.
 
 2002-07-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
index 2cf842fc12d6b122be530b6948cb49be9d17a9f1..a610867217052d16e696fbed79ae80ef5fab88ff 100644 (file)
-//\r
-// System.Web.HttpContext\r
-//\r
-// Author:\r
-//   Patrik Torstensson (Patrik.Torstensson@labs2.com)\r
-//\r
-using System;\r
-using System.Collections;\r
-using System.Security.Principal;\r
-using System.Web.Caching;\r
-using System.Web.Configuration;\r
-using System.Web.SessionState;\r
-using System.Threading;\r
-\r
-namespace System.Web {\r
-   public sealed class HttpContext : IServiceProvider {\r
-      private Exception []     _arrExceptions;\r
-\r
-      private HttpResponse     _oResponse;\r
-      private HttpRequest _oRequest;\r
-      private HttpServerUtility _Server;\r
-      private HttpApplication _oApplication;\r
-               private HttpWorkerRequest _oWorkerRequest;\r
-      private IHttpHandler _Handler;\r
-               private IHttpAsyncHandler _AsyncHandler;\r
-      private IPrincipal _User;\r
-      \r
-               private bool _skipauth;\r
-      private Hashtable                _oItems;\r
-      private DateTime         _oTimestamp;\r
-\r
-      public HttpContext(HttpRequest Request, HttpResponse Response) {\r
-         Context = this;\r
-\r
-         _arrExceptions = null;\r
-         _oItems = null;\r
-         _oTimestamp = DateTime.Now;\r
-         _oRequest = Request;\r
-         _oResponse = Response;\r
-      }\r
-\r
-      public HttpContext(HttpWorkerRequest WorkerRequest) {\r
-         Context = this;\r
-\r
-         _arrExceptions = null;\r
-         _oItems = null;\r
-         _oTimestamp = DateTime.Now;\r
-         _oRequest = new HttpRequest(WorkerRequest, this);\r
-         _oResponse = new HttpResponse(WorkerRequest, this);\r
-                       _oWorkerRequest = WorkerRequest;\r
-      }\r
-\r
-               internal HttpWorkerRequest WorkerRequest {\r
-                       get {\r
-                               return _oWorkerRequest;\r
-                       }\r
-               }\r
-      \r
-      [MonoTODO("Context - Use System.Remoting.Messaging.CallContext instead of Thread storage")]\r
-      internal static HttpContext Context {\r
-         get {\r
-            return (HttpContext) Thread.GetData(Thread.GetNamedDataSlot("Context"));\r
-         }\r
-\r
-         set {\r
-            Thread.SetData(Thread.GetNamedDataSlot("Context"), value);\r
-         }\r
-      }\r
-\r
-      public Exception [] AllErrors {\r
-         get {\r
-            return _arrExceptions;\r
-         }\r
-      }\r
-\r
-      public HttpApplicationState Application {\r
-         get {\r
-            return HttpApplicationFactory.ApplicationState;\r
-         }\r
-               }\r
-\r
-      public HttpApplication ApplicationInstance {\r
-         get {\r
-            return _oApplication;\r
-         }\r
-         set {\r
-            _oApplication = value;\r
-         }\r
-      }\r
-\r
-      public Cache Cache {\r
-         get {\r
-                               return HttpRuntime.Cache;\r
-                       }\r
-      }\r
-\r
-      public static HttpContext Current {\r
-         get {\r
-            return Context;\r
-         }\r
-      }\r
-\r
-      public Exception Error {\r
-         get {\r
-            if (_arrExceptions == null || _arrExceptions.Length == 0)\r
-               return null;\r
-            else\r
-               return _arrExceptions[0];\r
-         }\r
-      }\r
-\r
-      public IHttpHandler Handler {\r
-         get {    \r
-            return _Handler;\r
-         }\r
-         \r
-         set {\r
-            _Handler = value;\r
-         }\r
-      }\r
-\r
-               internal IHttpAsyncHandler AsyncHandler {\r
-                       get {    \r
-                               return _AsyncHandler;\r
-                       }\r
-         \r
-                       set {\r
-                               _AsyncHandler = value;\r
-                       }\r
-               }\r
-               \r
-               [MonoTODO("bool IsCustomErrorEnabled")]\r
-      public bool IsCustomErrorEnabled {\r
-         get {\r
-            throw new NotImplementedException();\r
-         }\r
-      }\r
-\r
-      [MonoTODO("bool IsDebuggingEnabled")]\r
-      public bool IsDebuggingEnabled {\r
-         get {\r
-            throw new NotImplementedException();\r
-         }\r
-      }\r
-\r
-      public IDictionary Items {\r
-         get {\r
-            if (_oItems == null) {\r
-               _oItems = new Hashtable();\r
-            }\r
-                               \r
-            return _oItems;\r
-         }\r
-      }\r
-\r
-      public HttpRequest Request {\r
-         get {\r
-            return _oRequest;\r
-         }\r
-      }\r
-\r
-      public HttpResponse Response {\r
-         get {\r
-            return _oResponse;\r
-         }\r
-      }\r
-\r
-      public HttpServerUtility Server {\r
-         get {\r
-            if (null == _Server) {\r
-               _Server = new HttpServerUtility(this);\r
-            }\r
-            \r
-            return _Server; \r
-         }\r
-      }\r
-      \r
-      public HttpSessionState Session {\r
-         get {\r
-                               return (HttpSessionState) Items["sessionstate"];\r
-         }\r
-      }\r
-\r
-      public bool SkipAuthorization {\r
-         get {\r
-                               return _skipauth;\r
-         }\r
-\r
-         set {\r
-                               _skipauth = value;\r
-         }\r
-      }\r
-\r
-      public DateTime Timestamp {\r
-         get {\r
-            return _oTimestamp;\r
-         }\r
-      }\r
-      \r
-      [MonoTODO("TraceContext Trace")]\r
-      public TraceContext Trace {\r
-         get {\r
-            throw new NotImplementedException();\r
-         }\r
-      }\r
-      \r
-      public IPrincipal User {\r
-         get {\r
-            return _User;\r
-         }\r
-         set {\r
-            _User = value;\r
-         }\r
-      }\r
-               \r
-      public void AddError(Exception errorInfo) {\r
-         int iSize;\r
-\r
-         if (_arrExceptions == null) {\r
-            iSize = 1;\r
-         } \r
-         else {\r
-            iSize = _arrExceptions.Length + 1;\r
-         }\r
-\r
-         Exception [] arrNew = new Exception[iSize];\r
-\r
-                       if (null != _arrExceptions)\r
-                               _arrExceptions.CopyTo(arrNew, 0);\r
-\r
-                       _arrExceptions = arrNew;\r
-                       \r
-         _arrExceptions[iSize - 1] = errorInfo;\r
-      }\r
-\r
-      public void ClearError() {\r
-         _arrExceptions = null;\r
-      }\r
-\r
-      [MonoTODO("GetConfig(string name)")]\r
-      public object GetConfig(string name) {\r
-         throw new NotImplementedException();\r
-      }\r
-\r
-      [MonoTODO("GetAppConfig(string name)")]\r
-      public static object GetAppConfig(string name) {\r
-                       if (null == name)\r
-                               throw new NotImplementedException();\r
-\r
-         // This is a temp hack to fix the config stuff\r
-                       if  (name.ToLower() == "system.web/httpmodules") {\r
-                               return new ModulesConfiguration();\r
-                       }\r
-\r
-                       if (name.ToLower() == "system.web/globalization") {\r
-                               return new System.Web.Configuration.GlobalizationConfiguration();\r
-                       }\r
-                       \r
-                       throw new NotImplementedException();\r
-      }\r
-      \r
-               object IServiceProvider.GetService(Type service) {\r
-                       if (service == typeof(HttpWorkerRequest)) \r
-                               return _oWorkerRequest;\r
-\r
-                       if (service == typeof(HttpRequest))\r
-                               return Request;\r
-\r
-                       if (service == typeof(HttpResponse))\r
-                               return Response;\r
-\r
-                       if (service == typeof(HttpApplication))\r
-                               return ApplicationInstance;\r
-\r
-                       if (service == typeof(HttpApplicationState))\r
-                               return Application;\r
-\r
-                       if (service == typeof(HttpSessionState))\r
-                               return Session;\r
-\r
-                       if (service == typeof(HttpServerUtility))\r
-                               return Server;\r
-\r
-                       return null;\r
-      }\r
-\r
-      [MonoTODO("void RewritePath(string path)")]\r
-      public void RewritePath(string Path) {\r
-         throw new NotImplementedException();\r
-      }\r
-   }\r
-}\r
+//
+// System.Web.HttpContext
+//
+// Author:
+//   Patrik Torstensson (Patrik.Torstensson@labs2.com)
+//
+using System;
+using System.Collections;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.Configuration;
+using System.Web.SessionState;
+using System.Threading;
+
+namespace System.Web
+{
+       public sealed class HttpContext : IServiceProvider
+       {
+               private Exception []    _arrExceptions;
+
+               private HttpResponse    _oResponse;
+               private HttpRequest _oRequest;
+               private HttpServerUtility _Server;
+               private HttpApplication _oApplication;
+               private HttpWorkerRequest _oWorkerRequest;
+               private IHttpHandler _Handler;
+               private IHttpAsyncHandler _AsyncHandler;
+               private IPrincipal _User;
+
+               private bool _skipauth;
+               private Hashtable               _oItems;
+               private DateTime                _oTimestamp;
+
+               public HttpContext (HttpRequest Request, HttpResponse Response)
+               {
+                       Context = this;
+
+                       _arrExceptions = null;
+                       _oItems = null;
+                       _oTimestamp = DateTime.Now;
+                       _oRequest = Request;
+                       _oResponse = Response;
+               }
+
+               public HttpContext (HttpWorkerRequest WorkerRequest)
+               {
+                       Context = this;
+
+                       _arrExceptions = null;
+                       _oItems = null;
+                       _oTimestamp = DateTime.Now;
+                       _oRequest = new HttpRequest (WorkerRequest, this);
+                       _oResponse = new HttpResponse (WorkerRequest, this);
+                       _oWorkerRequest = WorkerRequest;
+               }
+
+               internal HttpWorkerRequest WorkerRequest
+               {
+                       get {
+                               return _oWorkerRequest;
+                       }
+               }
+
+               [MonoTODO("Context - Use System.Remoting.Messaging.CallContext instead of Thread storage")]
+               internal static HttpContext Context
+               {
+                       get {
+                               return (HttpContext) Thread.GetData (Thread.GetNamedDataSlot ("Context"));
+                       }
+
+                       set {
+                               Thread.SetData (Thread.GetNamedDataSlot ("Context"), value);
+                       }
+               }
+
+               public Exception [] AllErrors
+               {
+                       get {
+                               return _arrExceptions;
+                       }
+               }
+
+               public HttpApplicationState Application
+               {
+                       get {
+                               return HttpApplicationFactory.ApplicationState;
+                       }
+               }
+
+               public HttpApplication ApplicationInstance
+               {
+                       get {
+                               return _oApplication;
+                       }
+                       set {
+                               _oApplication = value;
+                       }
+               }
+
+               public Cache Cache
+               {
+                       get {
+                               return HttpRuntime.Cache;
+                       }
+               }
+
+               public static HttpContext Current
+               {
+                       get {
+                               return Context;
+                       }
+               }
+
+               public Exception Error
+               {
+                       get {
+                               if (_arrExceptions == null || _arrExceptions.Length == 0)
+                                       return null;
+
+                               return _arrExceptions [0];
+                       }
+               }
+
+               public IHttpHandler Handler
+               {
+                       get {    
+                               return _Handler;
+                       }
+
+                       set {
+                               _Handler = value;
+                       }
+               }
+
+               internal IHttpAsyncHandler AsyncHandler
+               {
+                       get {    
+                               return _AsyncHandler;
+                       }
+
+                       set {
+                               _AsyncHandler = value;
+                       }
+               }
+
+               [MonoTODO("bool IsCustomErrorEnabled")]
+               public bool IsCustomErrorEnabled
+               {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               [MonoTODO("bool IsDebuggingEnabled")]
+               public bool IsDebuggingEnabled
+               {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public IDictionary Items
+               {
+                       get {
+                               if (_oItems == null)
+                                       _oItems = new Hashtable ();
+
+                               return _oItems;
+                       }
+               }
+
+               public HttpRequest Request
+               {
+                       get {
+                               return _oRequest;
+                       }
+               }
+
+               public HttpResponse Response
+               {
+                       get {
+                               return _oResponse;
+                       }
+               }
+
+               public HttpServerUtility Server
+               {
+                       get {
+                               if (null == _Server)
+                                       _Server = new HttpServerUtility (this);
+
+                               return _Server; 
+                       }
+               }
+
+               public HttpSessionState Session
+               {
+                       get {
+                               return (HttpSessionState) Items ["sessionstate"];
+                       }
+               }
+
+               public bool SkipAuthorization
+               {
+                       get {
+                               return _skipauth;
+                       }
+
+                       set {
+                               _skipauth = value;
+                       }
+               }
+
+               public DateTime Timestamp
+               {
+                       get {
+                               return _oTimestamp;
+                       }
+               }
+
+               [MonoTODO("TraceContext Trace")]
+               public TraceContext Trace
+               {
+                       get {
+                               throw new NotImplementedException();
+                       }
+               }
+
+               public IPrincipal User
+               {
+                       get {
+                               return _User;
+                       }
+                       set {
+                               _User = value;
+                       }
+               }
+
+               public void AddError (Exception errorInfo)
+               {
+                       int iSize = 1;
+
+                       if (_arrExceptions != null)
+                               iSize += _arrExceptions.Length;
+
+                       Exception [] arrNew = new Exception [iSize];
+
+                       if (null != _arrExceptions)
+                               _arrExceptions.CopyTo (arrNew, 0);
+
+                       _arrExceptions = arrNew;
+
+                       _arrExceptions [iSize - 1] = errorInfo;
+               }
+
+               public void ClearError ()
+               {
+                       _arrExceptions = null;
+               }
+
+               [MonoTODO("GetConfig(string name)")]
+               public object GetConfig (string name)
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("GetAppConfig(string name)")]
+               public static object GetAppConfig (string name)
+               {
+                       if (null == name)
+                               throw new NotImplementedException();
+
+                       // This is a temp hack to fix the config stuff
+                       if  (name.ToLower() == "system.web/httpmodules") {
+                               return new ModulesConfiguration();
+                       }
+
+                       if (name.ToLower() == "system.web/globalization") {
+                               return new System.Web.Configuration.GlobalizationConfiguration();
+                       }
+
+                       throw new NotImplementedException();
+               }
+
+               object IServiceProvider.GetService (Type service)
+               {
+                       if (service == typeof (HttpWorkerRequest)) 
+                               return _oWorkerRequest;
+
+                       if (service == typeof (HttpRequest))
+                               return Request;
+
+                       if (service == typeof (HttpResponse))
+                               return Response;
+
+                       if (service == typeof (HttpApplication))
+                               return ApplicationInstance;
+
+                       if (service == typeof (HttpApplicationState))
+                               return Application;
+
+                       if (service == typeof (HttpSessionState))
+                               return Session;
+
+                       if (service == typeof (HttpServerUtility))
+                               return Server;
+
+                       return null;
+               }
+
+               [MonoTODO("void RewritePath(string path)")]
+               public void RewritePath (string Path)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
+
index 30b26fce1abb653f009d5210821750cb5a3b14b2..d2027061ea2add69aabe9b3e613ae8d5d053da45 100644 (file)
@@ -14,26 +14,21 @@ namespace System.Web {
          return this[name];\r
       }\r
 \r
-      [MonoTODO()]\r
       public IEnumerator GetEnumerator() {\r
-         throw new NotImplementedException();\r
+         return _Objects.GetEnumerator ();\r
       }\r
       \r
       public void CopyTo(Array array, int index) {\r
-         IEnumerator Enum = GetEnumerator();\r
-         while (Enum.MoveNext()) {\r
-            array.SetValue(Enum.Current, ++index);\r
-         }\r
+        _Objects.CopyTo (array, index);\r
       }   \r
 \r
       internal IDictionary GetObjects() {\r
          return _Objects;\r
       }\r
 \r
-      [MonoTODO()]\r
       public object this[string name] {\r
          get {\r
-            throw new NotImplementedException();\r
+            return _Objects [name];\r
          }\r
       }\r
 \r