Author: andrews
Date: 2006-07-16 10:11:24 -0400 (Sun, 16 Jul 2006)
New Revision: 62657

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs
Log:
* SiteMapPath.cs: create Literal instead of Label according to the MSDN and 
test SiteMapPath_InitializeItem.


Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-07-16 13:12:48 UTC (rev 62656)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-07-16 14:11:24 UTC (rev 62657)
@@ -1,3 +1,8 @@
+2006-07-16 Andrew Skiba <[EMAIL PROTECTED]>
+
+       * SiteMapPath.cs: create Literal instead of Label according to the
+       MSDN and test SiteMapPath_InitializeItem.
+
 2006-07-16 Vladimir Krasnov <[EMAIL PROTECTED]>
 
        * Style.cs: BorderStyle should be added if BorderWidth greater than 0

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs 
2006-07-16 13:12:48 UTC (rev 62656)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs 
2006-07-16 14:11:24 UTC (rev 62657)
@@ -356,7 +356,7 @@
                                                NodeTemplate.InstantiateIn 
(item);
                                        }
                                        else {
-                                               WebControl c = 
CreateNodeControl (true, item);
+                                               WebControl c = CreateHyperLink 
(item);
                                                c.ApplyStyle (NodeStyle);
                                                c.ApplyStyle (RootNodeStyle);
                                                item.Controls.Add (c);
@@ -373,13 +373,17 @@
                                                item.ApplyStyle (NodeStyle);
                                                item.ApplyStyle 
(CurrentNodeStyle);
                                                NodeTemplate.InstantiateIn 
(item);
+                                       } else if (RenderCurrentNodeAsLink) {
+                                               HyperLink c = CreateHyperLink 
(item);
+                                               c.ApplyStyle (NodeStyle);
+                                               c.ApplyStyle (CurrentNodeStyle);
+                                               item.Controls.Add (c);
+                                       } else {
+                                               Literal c = CreateLiteral 
(item);
+                                               item.ApplyStyle (NodeStyle);
+                                               item.ApplyStyle 
(CurrentNodeStyle);
+                                               item.Controls.Add (c);
                                        }
-                                       else {
-                                               WebControl c = 
CreateNodeControl (RenderCurrentNodeAsLink, item);
-                                               c.ApplyStyle (NodeStyle);
-                                               c.ApplyStyle (CurrentNodeStyle);
-                                               item.Controls.Add (c);
-                                       }
                                        break;
                                        
                                case SiteMapNodeItemType.Parent:
@@ -388,7 +392,7 @@
                                                NodeTemplate.InstantiateIn 
(item);
                                        }
                                        else {
-                                               WebControl c = 
CreateNodeControl (true, item);
+                                               WebControl c = CreateHyperLink 
(item);
                                                c.ApplyStyle (NodeStyle);
                                                item.Controls.Add (c);
                                        }
@@ -400,32 +404,32 @@
                                                
PathSeparatorTemplate.InstantiateIn (item);
                                        }
                                        else {
-                                               Label h = new Label ();
-                                               h.Text = PathSeparator;
-                                               h.ApplyStyle 
(PathSeparatorStyle);
-                                               item.Controls.Add (h);
+                                               Literal h = new Literal ();
+                                               h.Text = PathSeparator;
+                                               item.ApplyStyle 
(PathSeparatorStyle);
+                                               item.Controls.Add (h);
                                        }
                                        break;
                        }
                }
                
-               WebControl CreateNodeControl (bool link, SiteMapNodeItem item)
+               HyperLink CreateHyperLink (SiteMapNodeItem item)
                {
-                       if (link) {
-                               HyperLink h = new HyperLink ();
-                               h.Text = item.SiteMapNode.Title;
-                               h.NavigateUrl = item.SiteMapNode.Url;
-                               if (ShowToolTips)
-                                       h.ToolTip = 
item.SiteMapNode.Description;
-                               return h;
-                       }
-                       else {
-                               Label h = new Label ();
-                               h.Text = item.SiteMapNode.Title;
-                               if (ShowToolTips)
-                                       h.ToolTip = 
item.SiteMapNode.Description;
-                               return h;
-                       }
+                       HyperLink h = new HyperLink ();
+                       h.Text = item.SiteMapNode.Title;
+                       h.NavigateUrl = item.SiteMapNode.Url;
+                       if (ShowToolTips)
+                               h.ToolTip = item.SiteMapNode.Description;
+                       return h;
+               }
+
+               Literal CreateLiteral (SiteMapNodeItem item)
+               {
+                       Literal h = new Literal ();
+                       h.Text = item.SiteMapNode.Title;
+                       if (ShowToolTips)
+                               item.ToolTip = item.SiteMapNode.Description;
+                       return h;
                }
                
                protected override void LoadViewState (object savedState)

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

Reply via email to