Author: adar
Date: 2007-01-18 06:13:53 -0500 (Thu, 18 Jan 2007)
New Revision: 71251

Modified:
   
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
Log:
2007-01-18  Adar Wesley <[EMAIL PROTECTED]>

        * SiteMapDataSource.cs: implemented logic of GetStartNode when
        StartingNodeOffset is positive.


Modified: 
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- 
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
     2007-01-18 10:57:54 UTC (rev 71250)
+++ 
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
     2007-01-18 11:13:53 UTC (rev 71251)
@@ -1,3 +1,8 @@
+2007-01-18  Adar Wesley <[EMAIL PROTECTED]>
+
+        * SiteMapDataSource.cs: implemented logic of GetStartNode when
+        StartingNodeOffset is positive.
+
 2007-01-17  Adar Wesley <[EMAIL PROTECTED]>
 
        * Repeater.cs: refactored GetData to return data both from DataSource

Modified: 
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
===================================================================
--- 
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
  2007-01-18 10:57:54 UTC (rev 71250)
+++ 
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
  2007-01-18 11:13:53 UTC (rev 71251)
@@ -35,6 +35,7 @@
 using System.Web.UI;
 using System.Web.Util;
 using System.ComponentModel;
+using System.Collections.Generic;
 
 namespace System.Web.UI.WebControls
 {
@@ -206,6 +207,18 @@
                                }
                        }
                        else if (StartingNodeOffset > 0) {
+                               List<SiteMapNode> pathCurrentToStartingNode = 
new List<SiteMapNode> ();
+                               SiteMapNode tmpNode = Provider.CurrentNode;
+                               while (tmpNode != null && tmpNode != 
starting_node) {
+                                       pathCurrentToStartingNode.Insert (0, 
tmpNode);
+                                       tmpNode = tmpNode.ParentNode;
+                               }
+                               if (tmpNode == starting_node &&
+                                       StartingNodeOffset <= 
pathCurrentToStartingNode.Count) {
+                                       // The requested node is in the same 
subtree as the starting_node
+                                       // try to advance on this path.
+                                       starting_node = 
pathCurrentToStartingNode [StartingNodeOffset - 1];
+                               }
                        }
 
                        return starting_node;
@@ -225,3 +238,4 @@
 
 #endif
 
+

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

Reply via email to