瀏覽代碼

2002-10-24 Gonzalo Paniagua Javier <[email protected]>

	* System.Web.build: added options (commented out) to activate tracing.

	* System.Web/HttpResponse.cs: don't throw exception in a couple of
	methods not yet implemented.

	* System.Web.Compilation/AspComponentFoundry.cs: fixed typo.

	* System.Web.Compilation/AspGenerator.cs: don't use FileDependencies
	property of base class.

	* System.Web.Compilation/TemplateFactory.cs: use csc style options.

	* System.Web.UI/Page.cs: set the context in ProcessRequest. Added a
	few trace calls.
	* System.Web.UI/Control.cs: added some trace information.

svn path=/trunk/mcs/; revision=8527
Gonzalo Paniagua Javier 23 年之前
父節點
當前提交
740c71cc31

+ 4 - 0
mcs/class/System.Web/ChangeLog

@@ -1,3 +1,7 @@
+2002-10-24  Gonzalo Paniagua Javier <[email protected]>
+
+	* System.Web.build: added options (commented out) to activate tracing.
+
 2002-10-06  Gonzalo Paniagua Javier <[email protected]>
 
 	* list: added new file in System.Web.Handlers.

+ 1 - 1
mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs

@@ -63,7 +63,7 @@ namespace System.Web.Compilation
 			string typeName;
 			Assembly assembly;
 
-			public InternalFoundry (string assemblyName, string nameSpave, string typeName)
+			public InternalFoundry (string assemblyName, string nameSpace, string typeName)
 			{
 				this.assemblyName = assemblyName;
 				this.nameSpace = nameSpace;

+ 1 - 1
mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs

@@ -1525,7 +1525,7 @@ class AspGenerator
 				"\t\t\tthis.__BuildControlTree (this);\n");
 
 		if (!IsUserControl) {
-			epilog.AppendFormat ("\t\t\tthis.FileDependencies = ASP.{0}.__fileDependencies;\n" +
+			epilog.AppendFormat ("\t\t\tResponse.AddFileDependencies (ASP.{0}.__fileDependencies);\n" +
 						"\t\t\tthis.EnableViewStateMac = true;\n", className);
 		}
 		epilog.Append ("\t\t}\n\n");

+ 6 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,9 @@
+2002-10-23  Gonzalo Paniagua Javier <[email protected]>
+
+	* AspComponentFoundry.cs: fixed typo.
+	* TemplateFactory.cs: use csc style options.
+	* AspGenerator.cs: don't use FileDependencies property of base class.
+
 2002-09-28  Gonzalo Paniagua Javier <[email protected]>
 
 	* System.Web.Compilation/AspElements.cs:

+ 2 - 5
mcs/class/System.Web/System.Web.Compilation/TemplateFactory.cs

@@ -36,10 +36,7 @@ namespace System.Web.Compilation
 				csFileName = fileName;
 
 				cscOptions = new StringBuilder ();
-				cscOptions.Append ("--target library ");
-				cscOptions.Append ("-L . ");
-				AddReference ("corlib");
-				AddReference ("System");
+				cscOptions.Append ("/target:library ");
 				AddReference ("System.Data");
 				AddReference ("System.Web");
 				AddReference ("System.Drawing");
@@ -127,7 +124,7 @@ namespace System.Web.Compilation
 
 			private void AddReference (string reference)
 			{
-				string arg = String.Format ("/r:{0} ", reference);
+				string arg = String.Format ("/r:{0}.dll ", reference);
 				cscOptions.Append (arg);
 			}
 			

+ 5 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,8 @@
+2002-10-24  Gonzalo Paniagua Javier <[email protected]>
+
+	* Page.cs: set the context in ProcessRequest. Added a few trace calls.
+	* Control.cs: added some trace information.
+
 2002-10-08  Gonzalo Paniagua Javier <[email protected]>
 
 	* SimpleHandlerFactory.cs: new handler for .ashx files.

+ 11 - 2
mcs/class/System.Web/System.Web.UI/Control.cs

@@ -81,8 +81,9 @@
 
 using System;
 using System.Collections;
-using System.Web;
 using System.ComponentModel;
+using System.Web;
+using System.Web.Utils;
 
 namespace System.Web.UI
 {
@@ -349,8 +350,12 @@ namespace System.Web.UI
 
                 protected virtual void AddParsedSubObject(object obj) //DIT
                 {
-                        Control c = (Control)obj;
+			WebTrace.PushContext ("Control.AddParsedSubobject ()");
+                        Control c = obj as Control;
+			WebTrace.WriteLine ("Start: {0} -> {1}", obj, (c != null) ? c.ID : String.Empty);
                         if (c != null) Controls.Add(c);
+			WebTrace.WriteLine ("End");
+			WebTrace.PopContext ();
                 }
                 protected void BuildProfileTree(string parentId, bool calcViewState)
                 {
@@ -610,7 +615,11 @@ namespace System.Web.UI
 
                 public void SetRenderMethodDelegate(RenderMethod renderMethod) //DIT
                 {
+			WebTrace.PushContext ("Control.AddParsedSubobject ()");
+			WebTrace.WriteLine ("Start");
                         _renderMethodDelegate = renderMethod;
+			WebTrace.WriteLine ("End");
+			WebTrace.PopContext ();
                 }
 
                 protected void LoadRecursive()

+ 14 - 0
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -18,6 +18,7 @@ using System.Text;
 using System.Web;
 using System.Web.Caching;
 using System.Web.SessionState;
+using System.Web.Utils;
 
 namespace System.Web.UI
 {
@@ -526,6 +527,9 @@ public class Page : TemplateControl, IHttpHandler
 	private bool init_done;
 	public void ProcessRequest (HttpContext context)
 	{
+		_context = context;
+		WebTrace.PushContext ("Page.ProcessRequest ()");
+		WebTrace.WriteLine ("Entering");
 		if (!init_done){
 			init_done = true;
 			// These should depend on AutoEventWireUp in Page directive. Defaults to true.
@@ -535,10 +539,14 @@ public class Page : TemplateControl, IHttpHandler
 			PreRender += new EventHandler (_Page_PreRender);
 			Disposed += new EventHandler (_Page_Dispose);
 			Error += new EventHandler (_Page_Error);
+			WebTrace.WriteLine ("Finished init");
 		}
 		//-- Control execution lifecycle in the docs
+		WebTrace.WriteLine ("Controls.Clear");
 		Controls.Clear ();
+		WebTrace.WriteLine ("FrameworkInitialize");
 		FrameworkInitialize ();
+		WebTrace.WriteLine ("InitRecursive");
 		InitRecursive (null);
 		got_state = false;
 		renderingForm = false;	
@@ -549,21 +557,27 @@ public class Page : TemplateControl, IHttpHandler
 			ProcessPostData (DeterminePostBackMode (), false);
 		}
 
+		WebTrace.WriteLine ("LoadRecursive");
 		LoadRecursive ();
 		if (IsPostBack) {
 			ProcessPostData (secondPostData, true);
 			RaiseChangedEvents ();
 			RaisePostBackEvents ();
 		}
+		WebTrace.WriteLine ("PreRenderRecursiveInternal");
 		PreRenderRecursiveInternal ();
 
+		WebTrace.WriteLine ("SavePageViewState");
 		SavePageViewState ();
 		//--
 		StringBuilder sb = new StringBuilder ();
 		StringWriter sr = new StringWriter (sb);
 		HtmlTextWriter output = new HtmlTextWriter (context.Response.Output);
+		WebTrace.WriteLine ("RenderControl");
 		RenderControl (output);
 		_context = null;
+		WebTrace.WriteLine ("End");
+		WebTrace.PopContext ();
 	}
 
 	internal void RaisePostBackEvents ()

+ 98 - 0
mcs/class/System.Web/System.Web.Util/WebTrace.cs

@@ -0,0 +1,98 @@
+//
+// System.Web.Utils.WebTrace
+//
+// Authors:
+//	Gonzalo Paniagua Javier ([email protected])
+//
+// (C) 2002 Ximian, Inc (http://www.ximian.com)
+//
+
+using System.Collections;
+using System.Diagnostics;
+
+namespace System.Web.Utils
+{
+	internal class WebTrace
+	{
+		static Stack ctxStack;
+		static bool trace;
+
+		static WebTrace ()
+		{
+			ctxStack = new Stack ();
+		}
+
+		[Conditional("WEBTRACE")]
+		static public void PushContext (string context)
+		{
+			ctxStack.Push (context);
+			Trace.Indent ();
+		}
+		
+		[Conditional("WEBTRACE")]
+		static public void PopContext ()
+		{
+			if (ctxStack.Count == 0)
+				return;
+
+			Trace.Unindent ();
+			ctxStack.Pop ();
+		}
+
+		static public string Context
+		{
+			get {
+				if (ctxStack.Count == 0)
+					return "No context";
+
+				return (string) ctxStack.Peek ();
+			}
+		}
+
+		static public bool StackTrace
+		{
+			get { return trace; }
+
+			set { trace = value; }
+		}
+		
+		[Conditional("WEBTRACE")]
+		static public void WriteLine (string msg)
+		{
+			Trace.WriteLine (Format (msg));
+		}
+
+		[Conditional("WEBTRACE")]
+		static public void WriteLine (string msg, object arg)
+		{
+			Trace.WriteLine (Format (String.Format (msg, arg)));
+		}
+
+		[Conditional("WEBTRACE")]
+		static public void WriteLine (string msg, object arg1, object arg2)
+		{
+			Trace.WriteLine (Format (String.Format (msg, arg1, arg2)));
+		}
+
+		[Conditional("WEBTRACE")]
+		static public void WriteLine (string msg, object arg1, object arg2, object arg3)
+		{
+			Trace.WriteLine (Format (String.Format (msg, arg1, arg2, arg3)));
+		}
+
+		[Conditional("WEBTRACE")]
+		static public void WriteLine (string msg, params object [] args)
+		{
+			Trace.WriteLine (Format (String.Format (msg, args)));
+		}
+
+		static string Format (string msg)
+		{
+			if (trace)
+				return String.Format ("{0}: {1}\n{2}", Context, msg, Environment.StackTrace);
+			else
+				return String.Format ("{0}: {1}", Context, msg);
+		}
+	}
+}
+

+ 4 - 0
mcs/class/System.Web/System.Web.build

@@ -8,6 +8,10 @@
 	<target name="build">
 		<mkdir dir="../lib"/>
 		<csc target="library" output="../lib/System.Web.dll" debug="${debug}">
+			<!-- Used to activate tracing
+			<arg value="/d:TRACE"/>
+			<arg value="/d:WEBTRACE"/>
+			-->
 			<arg value="/nowarn:1595"/>
 			<arg value="/nowarn:0169"/>
 			<arg value="/nowarn:0649"/> <!-- always default value -->

+ 5 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,8 @@
+2002-10-24  Gonzalo Paniagua Javier <[email protected]>
+
+	* HttpResponse.cs: don't throw exception in a couple of
+	methods not yet implemented.
+
 2002-10-08  Gonzalo Paniagua Javier <[email protected]>
 
 	* HttpApplication.cs: fixed type and handle factories when creating

+ 2 - 2
mcs/class/System.Web/System.Web/HttpResponse.cs

@@ -203,12 +203,12 @@ namespace System.Web {
 
       [MonoTODO()]
       public void AddFileDependencies(ArrayList filenames) {
-         throw new NotImplementedException();
+         //throw new NotImplementedException();
       }
 
       [MonoTODO()]
       public void AddFileDependency(string filename) {
-         throw new NotImplementedException();
+         //throw new NotImplementedException();
       }
 
       public void AddHeader(string name, string value) {