Author: igorz
Date: 2007-12-24 04:42:34 -0500 (Mon, 24 Dec 2007)
New Revision: 91853
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
Log:
2007-12-24 Igor Zelmanovich <[EMAIL PROTECTED]>
* TreeView.cs: revert changes from r91230
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2007-12-24 09:00:53 UTC (rev 91852)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2007-12-24 09:42:34 UTC (rev 91853)
@@ -1,3 +1,7 @@
+2007-12-24 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * TreeView.cs: revert changes from r91230
+
2007-12-18 Vladimir Krasnov <[EMAIL PROTECTED]>
* ListControl.cs: fixed Load/SaveViewState, removed selected indices
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
2007-12-24 09:00:53 UTC (rev 91852)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
2007-12-24 09:42:34 UTC (rev 91853)
@@ -1035,9 +1035,6 @@
}
return res;
}
-
- const string onPreRenderScript_1 = @"var {0} = new Object
();\n{0}.treeId = {1};\n{0}.uid = {2};\n{0}.showImage = {3};\n";
- const string onPreRenderScript_2 = @"{0}.form =
{1};\n{0}.PopulateNode = function(nodeId) {{ {2}; }};\n{0}.populateFromClient =
{3};\n{0}.expandAlt = {4};\n{0}.collapseAlt = {5};\n";
protected internal override void OnPreRender (EventArgs e)
{
@@ -1054,43 +1051,29 @@
}
string ctree = ClientID + "_data";
- string script = String.Format (onPreRenderScript_1,
- ctree,
-
ClientScriptManager.GetScriptLiteral (ClientID),
-
ClientScriptManager.GetScriptLiteral (UniqueID),
-
ClientScriptManager.GetScriptLiteral (ShowExpandCollapse));
+ string script = string.Format ("var {0} = new Object
();\n", ctree);
+ script += string.Format ("{0}.treeId = {1};\n", ctree,
ClientScriptManager.GetScriptLiteral (ClientID));
+ script += string.Format ("{0}.uid = {1};\n", ctree,
ClientScriptManager.GetScriptLiteral (UniqueID));
+ script += string.Format ("{0}.showImage = {1};\n",
ctree, ClientScriptManager.GetScriptLiteral (ShowExpandCollapse));
if (ShowExpandCollapse) {
bool defaultImages = ShowLines || ImageSet !=
TreeViewImageSet.Custom || (ExpandImageUrl == "" && CollapseImageUrl == "");
- script += String.Concat (ctree, ".defaultImages
= ", ClientScriptManager.GetScriptLiteral (defaultImages), ";\n");
+ script += string.Format ("{0}.defaultImages =
{1};\n", ctree, ClientScriptManager.GetScriptLiteral (defaultImages));
ImageStyle imageStyle = GetImageStyle ();
if (!defaultImages) {
- script += String.Concat (ctree,
- ".expandImage
= ",
-
ClientScriptManager.GetScriptLiteral (GetNodeImageUrl ("plus", imageStyle)),
- ";\n");
- script += String.Concat (ctree,
-
".collapseImage = ",
-
ClientScriptManager.GetScriptLiteral (GetNodeImageUrl ("minus", imageStyle)),
- ";\n");
+ script += string.Format
("{0}.expandImage = {1};\n", ctree, ClientScriptManager.GetScriptLiteral
(GetNodeImageUrl ("plus", imageStyle)));
+ script += string.Format
("{0}.collapseImage = {1};\n", ctree, ClientScriptManager.GetScriptLiteral
(GetNodeImageUrl ("minus", imageStyle)));
}
if (PopulateNodesFromClient)
- script += String.Concat (ctree,
-
".noExpandImage = ",
-
ClientScriptManager.GetScriptLiteral (GetNodeImageUrl ("noexpand", imageStyle)),
- ";\n");
+ script += string.Format
("{0}.noExpandImage = {1};\n", ctree, ClientScriptManager.GetScriptLiteral
(GetNodeImageUrl ("noexpand", imageStyle)));
}
if (Page != null) {
- script += String.Format (onPreRenderScript_2,
- ctree,
- Page.theForm,
-
Page.ClientScript.GetCallbackEventReference ("this.uid", "nodeId",
"TreeView_PopulateCallback",
-
"this.treeId + \" \" + nodeId",
-
"TreeView_PopulateCallback", false),
-
ClientScriptManager.GetScriptLiteral (PopulateNodesFromClient),
-
ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip (true, null)),
-
ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip (false, null)));
+ script += string.Format ("{0}.form = {1};\n",
ctree, Page.theForm);
+ script += string.Format ("{0}.PopulateNode =
function(nodeId) {{ {1}; }};\n", ctree,
Page.ClientScript.GetCallbackEventReference ("this.uid", "nodeId",
"TreeView_PopulateCallback", "this.treeId + \" \" + nodeId",
"TreeView_PopulateCallback", false));
+ script += string.Format
("{0}.populateFromClient = {1};\n", ctree, ClientScriptManager.GetScriptLiteral
(PopulateNodesFromClient));
+ script += string.Format ("{0}.expandAlt =
{1};\n", ctree, ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip
(true, null)));
+ script += string.Format ("{0}.collapseAlt =
{1};\n", ctree, ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip
(false, null)));
if (!Page.IsPostBack) {
SetNodesExpandedToDepthRecursive
(Nodes);
@@ -1113,12 +1096,8 @@
if (Page.Header == null)
throw new
InvalidOperationException ("Using TreeView.HoverNodeStyle requires Page.Header
to be non-null (e.g. <head runat=\"server\" />).");
RegisterStyle (HoverNodeStyle,
HoverNodeLinkStyle);
- script += String.Concat (ctree,
".hoverClass = ",
-
ClientScriptManager.GetScriptLiteral (HoverNodeStyle.RegisteredCssClass),
- ";\n");
- script += String.Concat (ctree,
".hoverLinkClass = ",
-
ClientScriptManager.GetScriptLiteral (HoverNodeLinkStyle.RegisteredCssClass),
- ";\n");
+ script += string.Format
("{0}.hoverClass = {1};\n", ctree, ClientScriptManager.GetScriptLiteral
(HoverNodeStyle.RegisteredCssClass));
+ script += string.Format
("{0}.hoverLinkClass = {1};\n", ctree, ClientScriptManager.GetScriptLiteral
(HoverNodeLinkStyle.RegisteredCssClass));
}
Page.ClientScript.RegisterStartupScript
(typeof(TreeView), this.UniqueID, script, true);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches