Author: igorz
Date: 2007-12-26 10:24:35 -0500 (Wed, 26 Dec 2007)
New Revision: 91898

Modified:
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/Control.cs
   trunk/mcs/class/System.Web/System.Web.UI/Page.cs
   trunk/mcs/class/System.Web/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web/TraceContext.cs
   trunk/mcs/class/System.Web/System.Web/TraceData.cs
Log:
2007-12-26 Igor Zelmanovich <[EMAIL PROTECTED]>
        
        * TraceContext.cs:
        * TraceData.cs:
        make trace considers control state info.                

2007-12-26 Igor Zelmanovich <[EMAIL PROTECTED]>

        * Control.cs:
        * Page.cs:
        make Trace considers control state info.                



Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-12-26 15:23:50 UTC 
(rev 91897)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-12-26 15:24:35 UTC 
(rev 91898)
@@ -1,3 +1,9 @@
+2007-12-26 Igor Zelmanovich <[EMAIL PROTECTED]>
+       
+       * TraceContext.cs:
+       * TraceData.cs:
+       make trace considers control state info.                
+
 2007-12-25 Igor Zelmanovich <[EMAIL PROTECTED]>
        
        * HttpApplication.cs: initialize culture each request.

Modified: trunk/mcs/class/System.Web/System.Web/TraceContext.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/TraceContext.cs       2007-12-26 
15:23:50 UTC (rev 91897)
+++ trunk/mcs/class/System.Web/System.Web/TraceContext.cs       2007-12-26 
15:24:35 UTC (rev 91898)
@@ -45,6 +45,9 @@
                bool data_saved;
                bool _haveTrace;
                Hashtable view_states;
+#if NET_2_0
+               Hashtable control_states;
+#endif
                Hashtable sizes;
 
                public TraceContext (HttpContext Context)
@@ -143,7 +146,11 @@
 
                        SetRequestDetails ();
                        if (_Context.Handler is Page)
+#if NET_2_0
+                               data.AddControlTree ((Page) _Context.Handler, 
view_states, control_states, sizes);
+#else
                                data.AddControlTree ((Page) _Context.Handler, 
view_states, sizes);
+#endif
 
                        AddCookies ();
                        AddHeaders ();
@@ -160,6 +167,15 @@
                        view_states [ctrl] = vs;
                }
 
+#if NET_2_0
+               internal void SaveControlState (Control ctrl, object vs) {
+                       if (control_states == null)
+                               control_states = new Hashtable ();
+
+                       control_states [ctrl] = vs;
+               }
+#endif
+
                internal void SaveSize (Control ctrl, int size)
                {
                        if (sizes == null)

Modified: trunk/mcs/class/System.Web/System.Web/TraceData.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/TraceData.cs  2007-12-26 15:23:50 UTC 
(rev 91897)
+++ trunk/mcs/class/System.Web/System.Web/TraceData.cs  2007-12-26 15:24:35 UTC 
(rev 91898)
@@ -69,14 +69,24 @@
                public int RenderSize;
                public int ViewstateSize;
                public int Depth;
+#if NET_2_0
+               public int ControlstateSize;
+#endif
 
+#if NET_2_0
+               public ControlTraceData (string controlId, Type type, int 
renderSize, int viewstateSize, int controlstateSize, int depth)
+#else
                public ControlTraceData (string controlId, Type type, int 
renderSize, int viewstateSize, int depth)
+#endif
                {
                        this.ControlId = controlId;
                        this.Type = type;
                        this.RenderSize = renderSize;
                        this.ViewstateSize = viewstateSize;
                        this.Depth = depth;
+#if NET_2_0
+                       this.ControlstateSize = controlstateSize;
+#endif
                }
        }
 
@@ -104,6 +114,7 @@
                private Queue <NameValueTraceData> cookie_data;
                private Queue <NameValueTraceData> header_data;
                private Queue <NameValueTraceData> servervar_data;
+               Hashtable ctrl_cs;
 #else
                private Queue info;
                private Queue control_data;
@@ -224,11 +235,18 @@
                        return res.Replace (" ", "&nbsp;");
                }
                
+#if NET_2_0
+               public void AddControlTree (Page page, Hashtable ctrl_vs, 
Hashtable ctrl_cs, Hashtable sizes)
+#else
                public void AddControlTree (Page page, Hashtable ctrl_vs, 
Hashtable sizes)
+#endif
                {
                        this.page = page;
                        this.ctrl_vs = ctrl_vs;
                        this.sizes = sizes;
+#if NET_2_0
+                       this.ctrl_cs = ctrl_cs;
+#endif
                        AddControl (page, 0);
                }
 
@@ -242,6 +260,9 @@
                                        c.GetType (),
                                        GetRenderSize (c),
                                        GetViewStateSize (c, (ctrl_vs != null) 
? ctrl_vs [c] : null),
+#if NET_2_0
+                                       GetViewStateSize (c, (ctrl_cs != null) 
? ctrl_cs [c] : null),
+#endif
                                        control_pos));
                        
                        if (c.HasControls ()) {
@@ -354,8 +375,16 @@
                        table.Rows.Add (AltRow ("Control Tree"));
                        table.Rows.Add (SubHeadRow ("Control Id", "Type",
                                                "Render Size Bytes (including 
children)",
-                                               String.Format ("View state Size 
(total: {0} bytes)(excluding children)",
-                                                               page_vs_size)));
+#if TARGET_J2EE
+                                               "ViewState Size (excluding 
children)"
+#else
+                                               String.Format ("ViewState Size 
(total: {0} bytes)(excluding children)",
+                                                               page_vs_size)
+#endif
+#if NET_2_0
+                                               ,"ControlState Size (excluding 
children)"
+#endif
+                                                       ));
                        
                        int pos = 0;
 #if NET_2_0
@@ -379,7 +408,11 @@
                                prefix += "&nbsp;&nbsp;&nbsp;&nbsp;";
                        RenderAltRow (table, pos, prefix + r.ControlId,
                                      r.Type.ToString (), r.RenderSize.ToString 
(),
+#if NET_2_0
+                                         r.ViewstateSize.ToString (), 
r.ControlstateSize.ToString ());
+#else
                                      r.ViewstateSize.ToString ());
+#endif
                }
                
                private void RenderCookies (HtmlTextWriter output)
@@ -484,9 +517,12 @@
                        }
 
                        string t1, t2;
+#if !TARGET_J2EE
                        if (i.TimeSinceFirst == 0) {
                                t1 = t2 = String.Empty;
-                       } else {
+                       } else
+#endif
+                       {
                                t1 = i.TimeSinceFirst.ToString ("0.000000");
                                t2 = i.TimeSinceLast.ToString ("0.000000");
                        }

Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-12-26 15:23:50 UTC 
(rev 91897)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-12-26 15:24:35 UTC 
(rev 91898)
@@ -1,3 +1,9 @@
+2007-12-26 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * Control.cs:
+       * Page.cs:
+       make Trace considers control state info.                
+
 2007-12-20 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * Page.cs:      refactoring:

Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2007-12-26 15:23:50 UTC 
(rev 91897)
+++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2007-12-26 15:24:35 UTC 
(rev 91898)
@@ -1528,8 +1528,8 @@
                        if (!EnableViewState)
                                return null;
 
+                       TraceContext trace = (Context != null && 
Context.Trace.IsEnabled) ? Context.Trace : null;
 #if MONO_TRACE
-                       TraceContext trace = (Context != null && 
Context.Trace.IsEnabled) ? Context.Trace : null;
                        string type_name = null;
                        if (trace != null) {
                                type_name = GetType ().Name;
@@ -1562,21 +1562,21 @@
 
                        object thisState = SaveViewState ();
                        if (thisState == null && controlList == null && 
controlStates == null) {
+                               if (trace != null) {
 #if MONO_TRACE
-                               if (trace != null) {
                                        trace.Write ("control", "End 
SaveViewStateRecursive " + _userId + " " + type_name + " saved nothing");
+#endif
                                        trace.SaveViewState (this, null);
                                }
-#endif
                                return null;
                        }
 
+                       if (trace != null) {
 #if MONO_TRACE
-                       if (trace != null) {
                                trace.Write ("control", "End 
SaveViewStateRecursive " + _userId + " " + type_name + " saved a Triplet");
+#endif
                                trace.SaveViewState (this, thisState);
                        }
-#endif
                        return new Triplet (thisState, controlList, 
controlStates);
                }
 

Modified: trunk/mcs/class/System.Web/System.Web.UI/Page.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Page.cs    2007-12-26 15:23:50 UTC 
(rev 91897)
+++ trunk/mcs/class/System.Web/System.Web.UI/Page.cs    2007-12-26 15:24:35 UTC 
(rev 91898)
@@ -2598,6 +2598,11 @@
                for (int n=0; n<state.Length; n++) {
                        state [n] = ((Control) requireStateControls 
[n]).SaveControlState ();
                        if (state [n] != null) allNull = false;
+                       
+                       TraceContext trace = (Context != null && 
Context.Trace.IsEnabled) ? Context.Trace : null;
+                       if (trace != null)
+                               trace.SaveControlState ((Control) 
requireStateControls [n], state [n]);
+
                }
                if (allNull) return null;
                else return state;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to