Author: lluis
Date: 2005-05-26 12:17:00 -0400 (Thu, 26 May 2005)
New Revision: 45062

Added:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItem.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs
Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/CollectionDataSource.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/CommandField.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRow.cs
   
trunk/mcs/class/System.Web/System.Web.UI.WebControls/HierarchicalDataBoundControl.cs
   
trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemTemplateContainer.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSourceView.cs
   
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapHierarchicalDataSourceView.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSourceView.cs
Log:
2005-05-26  Lluis Sanchez Gual <[EMAIL PROTECTED]>

        * DataListItem.cs:
        * GridViewRow.cs:
        * DataGridItem.cs:
        * RepeaterItem.cs:
        * FormView.cs:
        * MenuItemTemplateContainer.cs:
        * DetailsView.cs: Track changes in the IDataItemContainer interface.
        
        * CommandField.cs: Added CausesValidation property. Set that
        property value to all buttons of the field.
        
        * SqlDataSourceView.cs:
        * CollectionDataSource.cs:
        * XmlDataSourceView.cs: Properly initialize the base class.
        
        * SiteMapDataSource.cs:
        * SiteMapHierarchicalDataSourceView.cs:
        * SiteMapNodeItem.cs:
        * SiteMapDataSourceView.cs:
        * SiteMapPath.cs: Mostly implemented.
        
        * HierarchicalDataBoundControl.cs: Always bind the control when the
        page is loaded for the first time.
        
        * TreeView.cs: Properly bind the control when loaded from a callback.



Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2005-05-26 16:17:00 UTC (rev 45062)
@@ -1,3 +1,31 @@
+2005-05-26  Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+       * DataListItem.cs:
+       * GridViewRow.cs:
+       * DataGridItem.cs:
+       * RepeaterItem.cs:
+       * FormView.cs:
+       * MenuItemTemplateContainer.cs:
+       * DetailsView.cs: Track changes in the IDataItemContainer interface.
+       
+       * CommandField.cs: Added CausesValidation property. Set that
+       property value to all buttons of the field.
+       
+       * SqlDataSourceView.cs:
+       * CollectionDataSource.cs:
+       * XmlDataSourceView.cs: Properly initialize the base class.
+       
+       * SiteMapDataSource.cs:
+       * SiteMapHierarchicalDataSourceView.cs:
+       * SiteMapNodeItem.cs:
+       * SiteMapDataSourceView.cs:
+       * SiteMapPath.cs: Mostly implemented.
+       
+       * HierarchicalDataBoundControl.cs: Always bind the control when the
+       page is loaded for the first time.
+       
+       * TreeView.cs: Properly bind the control when loaded from a callback.
+
 2005-05-21  Ben Maurer  <[EMAIL PROTECTED]>
 
        * BaseDataList.cs: Caption is in 1.1 too, though not

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CollectionDataSource.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CollectionDataSource.cs    
    2005-05-26 16:16:29 UTC (rev 45061)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CollectionDataSource.cs    
    2005-05-26 16:17:00 UTC (rev 45062)
@@ -56,7 +56,7 @@
                
                public DataSourceView GetView (string viewName)
                {
-                       return new CollectionDataSourceView (collection);
+                       return new CollectionDataSourceView (this, viewName, 
collection);
                }
                
                public ICollection GetViewNames ()
@@ -69,7 +69,8 @@
        {
                IEnumerable collection;
 
-               public CollectionDataSourceView (IEnumerable collection)
+               public CollectionDataSourceView (IDataSource owner, string 
viewName, IEnumerable collection)
+               : base (owner, viewName)
                {
                        this.collection = collection;
                }

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/CommandField.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/CommandField.cs        
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/CommandField.cs        
2005-05-26 16:17:00 UTC (rev 45062)
@@ -71,6 +71,19 @@
                        }
                }
 
+           [DefaultValueAttribute (true)]
+               public override bool CausesValidation {
+                       get {
+                               object ob = ViewState ["CausesValidation"];
+                               if (ob != null) return (bool) ob;
+                               return true;
+                       }
+                       set {
+                               ViewState ["CausesValidation"] = value;
+                               OnFieldChanged ();
+                       }
+               }
+
                [EditorAttribute ("System.Web.UI.Design.ImageUrlEditor, 
System.Design, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, 
System.Drawing, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a")]
                [WebCategoryAttribute ("Appearance")]
                [UrlPropertyAttribute]
@@ -329,39 +342,46 @@
                        if (cellType == DataControlCellType.DataCell)
                        {
                                if ((rowState & DataControlRowState.Edit) != 0) 
{
-                                       cell.Controls.Add (new 
DataControlButton (Control, UpdateText, UpdateImageUrl, 
DataControlCommands.UpdateCommandName, index, false));
+                                       cell.Controls.Add (CreateButton 
(UpdateText, UpdateImageUrl, DataControlCommands.UpdateCommandName, index));
                                        if (ShowCancelButton) {
                                                AddSeparator (cell);
-                                               cell.Controls.Add (new 
DataControlButton (Control, CancelText, CancelImageUrl, 
DataControlCommands.CancelCommandName, index, false));
+                                               cell.Controls.Add (CreateButton 
(CancelText, CancelImageUrl, DataControlCommands.CancelCommandName, index));
                                        }
                                } else if ((rowState & 
DataControlRowState.Insert) != 0) {
-                                       cell.Controls.Add (new 
DataControlButton (Control, InsertText, InsertImageUrl, 
DataControlCommands.InsertCommandName, index, false));
+                                       cell.Controls.Add (CreateButton 
(InsertText, InsertImageUrl, DataControlCommands.InsertCommandName, index));
                                        if (ShowCancelButton) {
                                                AddSeparator (cell);
-                                               cell.Controls.Add (new 
DataControlButton (Control, CancelText, CancelImageUrl, 
DataControlCommands.CancelCommandName, index, false));
+                                               cell.Controls.Add (CreateButton 
(CancelText, CancelImageUrl, DataControlCommands.CancelCommandName, index));
                                        }
                                } else {
                                        if (ShowEditButton) {
                                                AddSeparator (cell);
-                                               cell.Controls.Add (new 
DataControlButton (Control, EditText, EditImageUrl, 
DataControlCommands.EditCommandName, index, false));
+                                               cell.Controls.Add (CreateButton 
(EditText, EditImageUrl, DataControlCommands.EditCommandName, index));
                                        }
                                        if (ShowDeleteButton) {
                                                AddSeparator (cell);
-                                               cell.Controls.Add (new 
DataControlButton (Control, DeleteText, DeleteImageUrl, 
DataControlCommands.DeleteCommandName, index, false));
+                                               cell.Controls.Add (CreateButton 
(DeleteText, DeleteImageUrl, DataControlCommands.DeleteCommandName, index));
                                        }
                                        if (ShowSelectButton) {
                                                AddSeparator (cell);
-                                               cell.Controls.Add (new 
DataControlButton (Control, SelectText, SelectImageUrl, 
DataControlCommands.SelectCommandName, index, false));
+                                               cell.Controls.Add (CreateButton 
(SelectText, SelectImageUrl, DataControlCommands.SelectCommandName, index));
                                        }
                                        if (ShowInsertButton) {
                                                AddSeparator (cell);
-                                               cell.Controls.Add (new 
DataControlButton (Control, NewText, NewImageUrl, 
DataControlCommands.NewCommandName, index, false));
+                                               cell.Controls.Add (CreateButton 
(NewText, NewImageUrl, DataControlCommands.NewCommandName, index));
                                        }
                                }
                        } else
                                base.InitializeCell (cell, cellType, rowState, 
rowIndex);
                }
                
+               DataControlButton CreateButton (string text, string image, 
string command, string arg)
+               {
+                       DataControlButton c = new DataControlButton (Control, 
text, image, command, arg, false);
+                       c.CausesValidation = CausesValidation;
+                       return c;
+               }
+               
                void AddSeparator (DataControlFieldCell cell)
                {
                        if (cell.Controls.Count > 0) {
@@ -400,6 +420,10 @@
                        field.UpdateImageUrl = UpdateImageUrl;
                        field.UpdateText = UpdateText;
                }
+               
+               public override void ValidateSupportsCallback ()
+               {
+               }
        }
 }
 #endif

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs        
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs        
2005-05-26 16:17:00 UTC (rev 45062)
@@ -89,7 +89,17 @@
                        {
                                return itemType;
                        }
-               }
+               }
+               
+#if NET_2_0
+               int IDataItemContainer.DataItemIndex {
+                       get { return dataSetIndex; }
+               }
+
+               int IDataItemContainer.DisplayIndex {
+                       get { return itemIndex; }
+               }
+#endif
 
                protected override bool OnBubbleEvent(object source, EventArgs 
e)
                {

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs        
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs        
2005-05-26 16:17:00 UTC (rev 45062)
@@ -85,6 +85,16 @@
                        }
                }
 
+#if NET_2_0
+               int IDataItemContainer.DataItemIndex {
+                       get { return itemIndex; }
+               }
+
+               int IDataItemContainer.DisplayIndex {
+                       get { return itemIndex; }
+               }
+#endif
+
                public virtual void RenderItem (HtmlTextWriter writer, bool 
extractRows, bool tableLayout)
                {
                        if (extractRows){

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs 
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs 
2005-05-26 16:17:00 UTC (rev 45062)
@@ -872,6 +872,10 @@
                        get { return PageIndex; }
                }               
        
+               int IDataItemContainer.DisplayIndex {
+                       get { return PageIndex; }
+               }               
+       
                public virtual bool IsBindableType (Type type)
                {
                        return type.IsPrimitive || type == typeof(string) || 
type == typeof(DateTime) || type == typeof(Guid);

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs    
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs    
2005-05-26 16:17:00 UTC (rev 45062)
@@ -759,6 +759,10 @@
                        get { return PageIndex; }
                }               
        
+               int IDataItemContainer.DisplayIndex {
+                       get { return PageIndex; }
+               }               
+       
                public virtual bool IsBindableType (Type type)
                {
                        return type.IsPrimitive || type == typeof(string) || 
type == typeof(DateTime) || type == typeof(Guid);

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRow.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRow.cs 
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRow.cs 
2005-05-26 16:17:00 UTC (rev 45062)
@@ -83,13 +83,13 @@
                        get { return DataItem; }
                }
                
-/*             int IDataItemContainer.DataItemIndex {
+               int IDataItemContainer.DataItemIndex {
                        get { return DataItemIndex; }
                }
                
                int IDataItemContainer.DisplayIndex {
                        get { return RowIndex; }
-               }*/     
+               }
                
                protected override bool OnBubbleEvent (object source, EventArgs 
e)
                {

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/HierarchicalDataBoundControl.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/HierarchicalDataBoundControl.cs
        2005-05-26 16:16:29 UTC (rev 45061)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/HierarchicalDataBoundControl.cs
        2005-05-26 16:17:00 UTC (rev 45062)
@@ -86,6 +86,9 @@
 
                protected override void OnLoad (EventArgs e)
                {
+                       if (IsBoundUsingDataSourceID && (!Page.IsPostBack || 
!EnableViewState))
+                               RequiresDataBinding = true;
+               
                        IHierarchicalDataSource ds = GetDataSource ();
                        if (ds != null && DataSourceID != "")
                                ds.DataSourceChanged += new EventHandler 
(OnDataSourceChanged);

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemTemplateContainer.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemTemplateContainer.cs
   2005-05-26 16:16:29 UTC (rev 45061)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemTemplateContainer.cs
   2005-05-26 16:17:00 UTC (rev 45062)
@@ -64,9 +64,17 @@
                        set { dataItem = value; }
                }
                
-               public object ItemIndex {
+               public int ItemIndex {
                        get { return index; }
                }
+               
+               int IDataItemContainer.DataItemIndex {
+                       get { return index; }
+               }
+
+               int IDataItemContainer.DisplayIndex {
+                       get { return index; }
+               }
        }
 }
 

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs        
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs        
2005-05-26 16:17:00 UTC (rev 45062)
@@ -74,6 +74,16 @@
                        }
                }
 
+#if NET_2_0
+               int IDataItemContainer.DataItemIndex {
+                       get { return itemIndex; }
+               }
+               
+               int IDataItemContainer.DisplayIndex {
+                       get { return itemIndex; }
+               }
+#endif
+
                public virtual ListItemType ItemType
                {
                        get

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs   
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs   
2005-05-26 16:17:00 UTC (rev 45062)
@@ -33,6 +33,7 @@
 using System;
 using System.Collections;
 using System.Web.UI;
+using System.Web.Util;
 using System.ComponentModel;
 
 namespace System.Web.UI.WebControls
@@ -42,36 +43,158 @@
        [ParseChildrenAttribute (true)]
        public class SiteMapDataSource : HierarchicalDataSourceControl, 
IDataSource, IListSource
        {
-               [MonoTODO]
-               [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
-               [BrowsableAttribute (false)]
-               public DataSourceView GetView (string viewName)
-               {
-                       throw new NotImplementedException ();
-               }
+               static string[] emptyNames = new string[] { string.Empty };
                
-               [MonoTODO]
-               public ICollection GetViewNames ()
+               SiteMapProvider provider;
+               
+               public virtual ICollection GetViewNames ()
                {
-                       throw new NotImplementedException ();
+                       return emptyNames;
                }
                
-               [MonoTODO]
                public IList GetList ()
                {
-                       throw new NotImplementedException ();
+                       return ListSourceHelper.GetList (this);
                }
                
-               [MonoTODO]
+           [BrowsableAttribute (false)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Hidden)]
                public bool ContainsListCollection {
-                       get { throw new NotImplementedException (); }
+                       get { return ListSourceHelper.ContainsListCollection 
(this); }
                }
                
-               [MonoTODO]
-               public event EventHandler DataSourceChanged {
-                       add { throw new NotImplementedException (); }
-                       remove { throw new NotImplementedException (); }
+               event EventHandler IDataSource.DataSourceChanged {
+                       add { ((IHierarchicalDataSource)this).DataSourceChanged 
+= value; }
+                       remove { 
((IHierarchicalDataSource)this).DataSourceChanged -= value; }
                }
+               
+           [BrowsableAttribute (false)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Hidden)]
+               public SiteMapProvider Provider {
+                       get {
+                               if (provider == null) {
+                                       if (this.SiteMapProvider.Length == 0) {
+                                               provider = SiteMap.Provider;
+                                               if (provider == null)
+                                                       throw new HttpException 
("There is no default provider configured for the site.");
+                                       } else {
+                                               provider = SiteMap.Providers 
[this.SiteMapProvider];
+                                               if (provider == null)
+                                                       throw new HttpException 
("SiteMap provider '" + this.SiteMapProvider + "' not found.");
+                                       }
+                               }
+                               return provider;
+                       }
+                       set {
+                               provider = value;
+                               OnDataSourceChanged (EventArgs.Empty);
+                       }
+               }
+               
+           [DefaultValueAttribute ("")]
+               public string SiteMapProvider {
+                       get {
+                               object o = ViewState ["SiteMapProvider"];
+                               if (o != null) return (string) o;
+                               else return string.Empty;
+                       }
+                       set {
+                               ViewState ["SiteMapProvider"] = value;
+                               OnDataSourceChanged (EventArgs.Empty);
+                       }
+               }
+               
+           [DefaultValueAttribute ("")]
+           [EditorAttribute ("System.Web.UI.Design.UrlEditor, System.Design, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", 
"System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+           [UrlPropertyAttribute]
+               public string StartingNodeUrl {
+                       get {
+                               object o = ViewState ["StartingNodeUrl"];
+                               if (o != null) return (string) o;
+                               else return string.Empty;
+                       }
+                       set {
+                               ViewState ["StartingNodeUrl"] = value;
+                               OnDataSourceChanged (EventArgs.Empty);
+                       }
+               }
+               
+           [DefaultValueAttribute (false)]
+               public bool StartFromCurrentNode {
+                       get {
+                               object o = ViewState ["StartFromCurrentNode"];
+                               if (o != null) return (bool) o;
+                               else return false;
+                       }
+                       set {
+                               ViewState ["StartFromCurrentNode"] = value;
+                               OnDataSourceChanged (EventArgs.Empty);
+                       }
+               }
+               
+           [DefaultValueAttribute (true)]
+               public bool ShowStartingNode {
+                       get {
+                               object o = ViewState ["ShowStartingNode"];
+                               if (o != null) return (bool) o;
+                               else return true;
+                       }
+                       set {
+                               ViewState ["ShowStartingNode"] = value;
+                               OnDataSourceChanged (EventArgs.Empty);
+                       }
+               }
+
+               public DataSourceView GetView (string viewName)
+               {
+                       SiteMapNode node = GetStartNode (viewName);
+                       if (node == null)
+                               return new SiteMapDataSourceView (this, 
viewName, SiteMapNodeCollection.EmptyList);
+                       else if (ShowStartingNode)
+                               return new SiteMapDataSourceView (this, 
viewName, node);
+                       else
+                               return new SiteMapDataSourceView (this, 
viewName, node.ChildNodes);
+               }
+
+               protected override HierarchicalDataSourceView 
GetHierarchicalView (string viewPath)
+               {
+                       SiteMapNode node = GetStartNode (viewPath);
+                       if (node == null)
+                               return new SiteMapHierarchicalDataSourceView 
(SiteMapNodeCollection.EmptyList);
+                       else if (ShowStartingNode || node == null)
+                               return new SiteMapHierarchicalDataSourceView 
(node);
+                       else
+                               return new SiteMapHierarchicalDataSourceView 
(node.ChildNodes);
+               }
+               
+               SiteMapNode GetStartNode (string viewPath)
+               {
+                       if (viewPath != null && viewPath.Length != 0) {
+                               string url = MapUrl (StartingNodeUrl);
+                               return Provider.FindSiteMapNode (url);
+                       }
+                       else if (StartFromCurrentNode) {
+                               if (StartingNodeUrl.Length != 0)
+                                       throw new InvalidOperationException 
("StartingNodeUrl can't be set if StartFromCurrentNode is set to true.");
+                               return Provider.CurrentNode;
+                       }
+                       else if (StartingNodeUrl.Length != 0) {
+                               string url = MapUrl (StartingNodeUrl);
+                               SiteMapNode node = Provider.FindSiteMapNode 
(url);
+                               if (node == null) throw new ArgumentException 
("Can't find a site map node for the url: " + StartingNodeUrl);
+                               return node;
+                       }
+                       else
+                               return Provider.RootNode;
+               }
+               
+               string MapUrl (string url)
+               {
+                       if (UrlUtils.IsRelativeUrl (url))
+                               return UrlUtils.Combine 
(HttpRuntime.AppDomainAppVirtualPath, url);
+                       else
+                               return 
UrlUtils.ResolveVirtualPathFromAppAbsolute (url);
+               }
        }
 }
 

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSourceView.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSourceView.cs   
    2005-05-26 16:16:29 UTC (rev 45061)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSourceView.cs   
    2005-05-26 16:17:00 UTC (rev 45062)
@@ -4,6 +4,7 @@
 // Authors:
 //     Ben Maurer ([EMAIL PROTECTED])
 //     Sanjay Gupta ([EMAIL PROTECTED])
+//     Lluis Sanchez Gual ([EMAIL PROTECTED])
 //
 // (C) 2003 Ben Maurer
 // (C) 2004 Novell, Inc. (http://www.novell.com)
@@ -36,32 +37,33 @@
 using System.Text;
 using System.Web.UI;
 
-namespace System.Web.UI.WebControls {
-       public class SiteMapDataSourceView : DataSourceView {
-               public SiteMapDataSourceView (SiteMapDataSource owner, string 
viewName, SiteMapNode node) : this (owner, viewName, new SiteMapNodeCollection 
(node)) {}
+namespace System.Web.UI.WebControls
+{
+       public class SiteMapDataSourceView : DataSourceView
+       {
+               SiteMapNodeCollection collection;
+               
+               public SiteMapDataSourceView (SiteMapDataSource owner, string 
viewName, SiteMapNode node)
+               : this (owner, viewName, new SiteMapNodeCollection (node))
+               {
+               }
+               
                public SiteMapDataSourceView (SiteMapDataSource owner, string 
viewName, SiteMapNodeCollection collection)
+               : base (owner, viewName)
                {
                        this.collection = collection;
-                       this.viewName = viewName;
-                       this.owner = owner;
                }
                
-               [MonoTODO]
                public IEnumerable Select (DataSourceSelectArguments arguments)
                {
-                       throw new NotImplementedException ();
+                       return ExecuteSelect (arguments);
                }
 
-               [MonoTODO]
-               protected internal override IEnumerable ExecuteSelect (
-                                               DataSourceSelectArguments 
arguments)
+               protected internal override IEnumerable ExecuteSelect 
(DataSourceSelectArguments arguments)
                {
-                       throw new NotImplementedException ();
+                       arguments.RaiseUnsupportedCapabilitiesError (this);
+                       return collection;
                }
-               
-               SiteMapNodeCollection collection;
-               string viewName;
-               SiteMapDataSource owner;
        }
 }
 #endif

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapHierarchicalDataSourceView.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapHierarchicalDataSourceView.cs
   2005-05-26 16:16:29 UTC (rev 45061)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapHierarchicalDataSourceView.cs
   2005-05-26 16:17:00 UTC (rev 45062)
@@ -35,19 +35,21 @@
 {
        public class SiteMapHierarchicalDataSourceView : 
HierarchicalDataSourceView
        {
-               public SiteMapHierarchicalDataSourceView (SiteMapNode node) : 
this (new SiteMapNodeCollection (node)) {}
+               SiteMapNodeCollection collection;
+               
+               public SiteMapHierarchicalDataSourceView (SiteMapNode node) : 
this (new SiteMapNodeCollection (node))
+               {
+               }
+               
                public SiteMapHierarchicalDataSourceView (SiteMapNodeCollection 
collection)
                {
                        this.collection = collection;
                }
 
-               [MonoTODO]
                public override IHierarchicalEnumerable Select ()
                {
-                       throw new NotImplementedException ();
+                       return collection;
                }
-
-               SiteMapNodeCollection collection;
        }
 }
 #endif

Added: trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItem.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItem.cs     
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItem.cs     
2005-05-26 16:17:00 UTC (rev 45062)
@@ -0,0 +1,79 @@
+//
+// System.Web.UI.WebControls.SiteMapNodeItem.cs
+//
+// Authors:
+//     Lluis Sanchez Gual ([EMAIL PROTECTED])
+//
+// (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+
+#if NET_2_0
+
+namespace System.Web.UI.WebControls
+{
+       public class SiteMapNodeItem: WebControl, IDataItemContainer, 
INamingContainer
+       {
+               int itemIndex;
+               SiteMapNodeItemType itemType;
+               SiteMapNode node;
+               
+               public SiteMapNodeItem (int itemIndex, SiteMapNodeItemType 
itemType)
+               {
+                       this.itemIndex = itemIndex;
+                       SetItemType (itemType);
+               }
+               
+               protected internal virtual void SetItemType 
(SiteMapNodeItemType itemType)
+               {
+                       this.itemType = itemType;
+               }
+               
+               public virtual int ItemIndex {
+                       get { return itemIndex; }
+               }
+               
+               public virtual SiteMapNodeItemType ItemType {
+                       get { return itemType; }
+               }
+               
+               public virtual SiteMapNode SiteMapNode {
+                       get { return node; }
+                       set { node = value; }
+               }
+               
+               object IDataItemContainer.DataItem {
+                       get { return node; }
+               }
+               
+               int IDataItemContainer.DataItemIndex {
+                       get { return itemIndex; }
+               }
+               
+               int IDataItemContainer.DisplayIndex {
+                       get { return itemIndex; }
+               }
+       }
+}
+
+#endif

Added: trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs 
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapPath.cs 
2005-05-26 16:17:00 UTC (rev 45062)
@@ -0,0 +1,465 @@
+//
+// System.Web.UI.WebControls.SiteMapPath.cs
+//
+// Authors:
+//     Lluis Sanchez Gual ([EMAIL PROTECTED])
+//
+// (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+
+#if NET_2_0
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Web.UI.WebControls
+{
+       public class SiteMapPath: CompositeControl
+       {
+               SiteMapProvider provider;
+               
+               Style currentNodeStyle;
+               Style nodeStyle;
+               Style pathSeparatorStyle;
+               Style rootNodeStyle;
+               
+               ITemplate currentNodeTemplate;
+               ITemplate nodeTemplate;
+               ITemplate pathSeparatorTemplate;
+               ITemplate rootNodeTemplate;
+
+               private static readonly object ItemCreatedEvent = new object();
+               private static readonly object ItemDataBoundEvent = new 
object();
+               
+               public event SiteMapNodeItemEventHandler ItemCreated {
+                       add { Events.AddHandler (ItemCreatedEvent, value); }
+                       remove { Events.RemoveHandler (ItemCreatedEvent, 
value); }
+               }
+               
+               public event SiteMapNodeItemEventHandler ItemDataBound {
+                       add { Events.AddHandler (ItemDataBoundEvent, value); }
+                       remove { Events.RemoveHandler (ItemDataBoundEvent, 
value); }
+               }
+               
+               protected virtual void OnItemCreated (SiteMapNodeItemEventArgs 
e)
+               {
+                       if (Events != null) {
+                               SiteMapNodeItemEventHandler eh = 
(SiteMapNodeItemEventHandler) Events [ItemCreatedEvent];
+                               if (eh != null) eh (this, e);
+                       }
+               }
+               
+               protected virtual void OnItemDataBound 
(SiteMapNodeItemEventArgs e)
+               {
+                       if (Events != null) {
+                               SiteMapNodeItemEventHandler eh = 
(SiteMapNodeItemEventHandler) Events [ItemDataBoundEvent];
+                               if (eh != null) eh (this, e);
+                       }
+               }
+               
+           [DefaultValueAttribute (null)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Content)]
+           [NotifyParentPropertyAttribute (true)]
+           [PersistenceModeAttribute (PersistenceMode.InnerProperty)]
+               public Style CurrentNodeStyle {
+                       get {
+                               if (currentNodeStyle == null) {
+                                       currentNodeStyle = new Style ();
+                                       if (IsTrackingViewState)
+                                               
((IStateManager)currentNodeStyle).TrackViewState ();
+                               }
+                               return currentNodeStyle;
+                       }
+               }
+       
+               [DefaultValue (null)]
+               [TemplateContainer (typeof(SiteMapNodeItem), 
BindingDirection.OneWay)]
+               [PersistenceMode (PersistenceMode.InnerProperty)]
+           [Browsable (false)]
+               public virtual ITemplate CurrentNodeTemplate {
+                       get { return currentNodeTemplate; }
+                       set { currentNodeTemplate = value; UpdateControls (); }
+               }
+               
+           [DefaultValueAttribute (null)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Content)]
+           [NotifyParentPropertyAttribute (true)]
+           [PersistenceModeAttribute (PersistenceMode.InnerProperty)]
+               public Style NodeStyle {
+                       get {
+                               if (nodeStyle == null) {
+                                       nodeStyle = new Style ();
+                                       if (IsTrackingViewState)
+                                               
((IStateManager)nodeStyle).TrackViewState ();
+                               }
+                               return nodeStyle;
+                       }
+               }
+       
+               [DefaultValue (null)]
+               [TemplateContainer (typeof(SiteMapNodeItem), 
BindingDirection.OneWay)]
+               [PersistenceMode (PersistenceMode.InnerProperty)]
+           [Browsable (false)]
+               public virtual ITemplate NodeTemplate {
+                       get { return nodeTemplate; }
+                       set { nodeTemplate = value; UpdateControls (); }
+               }
+               
+           [DefaultValueAttribute (-1)]
+           [ThemeableAttribute (false)]
+               public virtual int ParentLevelsDisplayed {
+                       get {
+                               object ob = ViewState ["ParentLevelsDisplayed"];
+                               if (ob != null) return (int) ob;
+                               else return -1;
+                       }
+                       set {
+                               if (value < -1) throw new 
ArgumentOutOfRangeException ("value");
+                               ViewState ["ParentLevelsDisplayed"] = value;
+                               UpdateControls ();
+                       }
+               }
+               
+           [DefaultValueAttribute (PathDirection.RootToCurrent)]
+               public virtual PathDirection PathDirection {
+                       get {
+                               object ob = ViewState ["PathDirection"];
+                               if (ob != null) return (PathDirection) ob;
+                               else return PathDirection.RootToCurrent;
+                       }
+                       set {
+                               if (value != PathDirection.RootToCurrent && 
value != PathDirection.CurrentToRoot)
+                                       throw new ArgumentOutOfRangeException 
("value");
+                               ViewState ["PathDirection"] = value;
+                               UpdateControls ();
+                       }
+               }
+               
+           [DefaultValueAttribute (" > ")]
+           [LocalizableAttribute (true)]
+               public virtual string PathSeparator {
+                       get {
+                               object ob = ViewState ["PathSeparator"];
+                               if (ob != null) return (string) ob;
+                               else return " > ";
+                       }
+                       set {
+                               ViewState ["PathSeparator"] = value;
+                               UpdateControls ();
+                       }
+               }
+               
+           [DefaultValueAttribute (null)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Content)]
+           [NotifyParentPropertyAttribute (true)]
+           [PersistenceModeAttribute (PersistenceMode.InnerProperty)]
+               public Style PathSeparatorStyle {
+                       get {
+                               if (pathSeparatorStyle == null) {
+                                       pathSeparatorStyle = new Style ();
+                                       if (IsTrackingViewState)
+                                               
((IStateManager)pathSeparatorStyle).TrackViewState ();
+                               }
+                               return pathSeparatorStyle;
+                       }
+               }
+       
+               [DefaultValue (null)]
+               [TemplateContainer (typeof(SiteMapNodeItem), 
BindingDirection.OneWay)]
+               [PersistenceMode (PersistenceMode.InnerProperty)]
+           [Browsable (false)]
+               public virtual ITemplate PathSeparatorTemplate {
+                       get { return pathSeparatorTemplate; }
+                       set { pathSeparatorTemplate = value; UpdateControls (); 
}
+               }
+               
+           [BrowsableAttribute (false)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Hidden)]
+               public SiteMapProvider Provider {
+                       get {
+                               if (provider == null) {
+                                       if (this.SiteMapProvider.Length == 0) {
+                                               provider = SiteMap.Provider;
+                                               if (provider == null)
+                                                       throw new HttpException 
("There is no default provider configured for the site.");
+                                       } else {
+                                               provider = SiteMap.Providers 
[this.SiteMapProvider];
+                                               if (provider == null)
+                                                       throw new HttpException 
("SiteMap provider '" + this.SiteMapProvider + "' not found.");
+                                       }
+                               }
+                               return provider;
+                       }
+                       set {
+                               provider = value;
+                               UpdateControls ();
+                       }
+               }
+               
+           [DefaultValueAttribute (false)]
+               public virtual bool RenderCurrentNodeAsLink {
+                       get {
+                               object o = ViewState 
["RenderCurrentNodeAsLink"];
+                               if (o != null) return (bool) o;
+                               else return false;
+                       }
+                       set {
+                               ViewState ["RenderCurrentNodeAsLink"] = value;
+                               UpdateControls ();
+                       }
+               }
+               
+           [DefaultValueAttribute (null)]
+           [DesignerSerializationVisibilityAttribute 
(DesignerSerializationVisibility.Content)]
+           [NotifyParentPropertyAttribute (true)]
+           [PersistenceModeAttribute (PersistenceMode.InnerProperty)]
+               public Style RootNodeStyle {
+                       get {
+                               if (rootNodeStyle == null) {
+                                       rootNodeStyle = new Style ();
+                                       if (IsTrackingViewState)
+                                               
((IStateManager)rootNodeStyle).TrackViewState ();
+                               }
+                               return rootNodeStyle;
+                       }
+               }
+       
+               [DefaultValue (null)]
+               [TemplateContainer (typeof(SiteMapNodeItem), 
BindingDirection.OneWay)]
+               [PersistenceMode (PersistenceMode.InnerProperty)]
+           [Browsable (false)]
+               public virtual ITemplate RootNodeTemplate {
+                       get { return rootNodeTemplate; }
+                       set { rootNodeTemplate = value; UpdateControls (); }
+               }
+               
+           [DefaultValueAttribute (true)]
+           [ThemeableAttribute (false)]
+               public virtual bool ShowToolTips {
+                       get {
+                               object o = ViewState ["ShowToolTips"];
+                               if (o != null) return (bool) o;
+                               else return true;
+                       }
+                       set {
+                               ViewState ["ShowToolTips"] = value;
+                               UpdateControls ();
+                       }
+               }
+               
+           [DefaultValueAttribute ("")]
+           [ThemeableAttribute (false)]
+               public string SiteMapProvider {
+                       get {
+                               object o = ViewState ["SiteMapProvider"];
+                               if (o != null) return (string) o;
+                               else return string.Empty;
+                       }
+                       set {
+                               ViewState ["SiteMapProvider"] = value;
+                               UpdateControls ();
+                       }
+               }
+               
+               void UpdateControls ()
+               {
+                       ChildControlsCreated = false;
+               }
+               
+               protected override void CreateChildControls ()
+               {
+                       Controls.Clear ();
+                       CreateControlHierarchy ();
+               }
+               
+               protected virtual void CreateControlHierarchy ()
+               {
+                       ArrayList nodes = new ArrayList ();
+                       SiteMapNode node = Provider.CurrentNode;
+                       if (node == null) return;
+                       
+                       int levels = ParentLevelsDisplayed != -1 ? 
ParentLevelsDisplayed + 1 : int.MaxValue;
+                       
+                       while (node != null && levels > 0) {
+                               if (nodes.Count > 0) {
+                                       SiteMapNodeItem sep = new 
SiteMapNodeItem (nodes.Count, SiteMapNodeItemType.PathSeparator);
+                                       InitializeItem (sep);
+                                       SiteMapNodeItemEventArgs sargs = new 
SiteMapNodeItemEventArgs (sep);
+                                       OnItemCreated (sargs);
+                                       nodes.Add (sep);
+                               }
+
+                               SiteMapNodeItemType nt;
+                               if (nodes.Count == 0)
+                                       nt = SiteMapNodeItemType.Current;
+                               else if (node.ParentNode == null)
+                                       nt = SiteMapNodeItemType.Root;
+                               else
+                                       nt = SiteMapNodeItemType.Parent;
+                                       
+                               SiteMapNodeItem it = new SiteMapNodeItem 
(nodes.Count, nt);
+                               it.SiteMapNode = node;
+                               InitializeItem (it);
+                               
+                               SiteMapNodeItemEventArgs args = new 
SiteMapNodeItemEventArgs (it);
+                               OnItemCreated (args);
+                               
+                               it.DataBind ();
+                               OnItemDataBound (args);
+                               
+                               nodes.Add (it);
+                               node = node.ParentNode;
+                               levels--;
+                       }
+                       
+                       if (PathDirection == PathDirection.RootToCurrent) {
+                               for (int n=nodes.Count - 1; n>=0; n--)
+                                       Controls.Add ((Control)nodes[n]);
+                       } else {
+                               for (int n=0; n<nodes.Count; n++)
+                                       Controls.Add ((Control)nodes[n]);
+                       }
+               }
+               
+               protected virtual void InitializeItem (SiteMapNodeItem item)
+               {
+                       switch (item.ItemType) {
+                               case SiteMapNodeItemType.Root:
+                                       if (RootNodeTemplate != null) {
+                                               item.ApplyStyle (NodeStyle);
+                                               item.ApplyStyle (RootNodeStyle);
+                                               RootNodeTemplate.InstantiateIn 
(item);
+                                       }
+                                       else {
+                                               WebControl c = 
CreateNodeControl (true, item);
+                                               c.ApplyStyle (NodeStyle);
+                                               c.ApplyStyle (RootNodeStyle);
+                                               item.Controls.Add (c);
+                                       }
+                                       break;
+
+                               case SiteMapNodeItemType.Current:
+                                       if (CurrentNodeTemplate != null) {
+                                               item.ApplyStyle (NodeStyle);
+                                               item.ApplyStyle 
(CurrentNodeStyle);
+                                               
CurrentNodeTemplate.InstantiateIn (item);
+                                       }
+                                       else {
+                                               WebControl c = 
CreateNodeControl (RenderCurrentNodeAsLink, item);
+                                               c.ApplyStyle (NodeStyle);
+                                               c.ApplyStyle (CurrentNodeStyle);
+                                               item.Controls.Add (c);
+                                       }
+                                       break;
+                                       
+                               case SiteMapNodeItemType.Parent:
+                                       if (NodeTemplate != null) {
+                                               item.ApplyStyle (NodeStyle);
+                                               NodeTemplate.InstantiateIn 
(item);
+                                       }
+                                       else {
+                                               WebControl c = 
CreateNodeControl (true, item);
+                                               c.ApplyStyle (NodeStyle);
+                                               item.Controls.Add (c);
+                                       }
+                                       break;
+                                       
+                               case SiteMapNodeItemType.PathSeparator:
+                                       if (PathSeparatorTemplate != null) {
+                                               item.ApplyStyle 
(PathSeparatorStyle);
+                                               
PathSeparatorTemplate.InstantiateIn (item);
+                                       }
+                                       else {
+                                               Label h = new Label ();
+                                               h.Text = PathSeparator;
+                                               h.ApplyStyle 
(PathSeparatorStyle);
+                                               item.Controls.Add (h);
+                                       }
+                                       break;
+                       }
+               }
+               
+               WebControl CreateNodeControl (bool link, 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;
+                       }
+               }
+               
+               protected override void LoadViewState (object savedState)
+               {
+                       if (savedState == null) {
+                               base.LoadViewState (null);
+                               return;
+                       }
+                       
+                       object[] states = (object[]) savedState;
+                       base.LoadViewState (states [0]);
+                       
+                       if (states[1] != null) 
((IStateManager)CurrentNodeStyle).LoadViewState (states[1]);
+                       if (states[2] != null) 
((IStateManager)NodeStyle).LoadViewState (states[2]);
+                       if (states[3] != null) 
((IStateManager)PathSeparatorStyle).LoadViewState (states[3]);
+                       if (states[4] != null) 
((IStateManager)RootNodeStyle).LoadViewState (states[4]);
+               }
+               
+               protected override object SaveViewState ()
+               {
+                       object[] state = new object [5];
+                       state [0] = base.SaveViewState ();
+                       
+                       if (currentNodeStyle != null) state [1] = 
((IStateManager)currentNodeStyle).SaveViewState ();
+                       if (nodeStyle != null) state [2] = 
((IStateManager)nodeStyle).SaveViewState ();
+                       if (pathSeparatorStyle != null) state [3] = 
((IStateManager)pathSeparatorStyle).SaveViewState ();
+                       if (rootNodeStyle != null) state [4] = 
((IStateManager)rootNodeStyle).SaveViewState ();
+                       
+                       for (int n=0; n<state.Length; n++)
+                               if (state [n] != null) return state;
+                       return null;
+               }
+               
+               protected override void TrackViewState ()
+               {
+                       base.TrackViewState();
+                       if (currentNodeStyle != null) 
((IStateManager)currentNodeStyle).TrackViewState();
+                       if (nodeStyle != null) 
((IStateManager)nodeStyle).TrackViewState();
+                       if (pathSeparatorStyle != null) 
((IStateManager)pathSeparatorStyle).TrackViewState();
+                       if (rootNodeStyle != null) 
((IStateManager)rootNodeStyle).TrackViewState();
+               }
+       }
+}
+
+#endif

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs   
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs   
2005-05-26 16:17:00 UTC (rev 45062)
@@ -46,6 +46,7 @@
                HttpContext context;
 
                public SqlDataSourceView (SqlDataSource owner, string name, 
HttpContext context)
+               : base (owner, name)
                {
                        this.owner = owner;
                        this.name = name;

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs    
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs    
2005-05-26 16:17:00 UTC (rev 45062)
@@ -840,6 +840,9 @@
                
                protected virtual string RaiseCallbackEvent (string eventArgs)
                {
+                       RequiresDataBinding = true;
+                       EnsureDataBound ();
+                       
                        TreeNode node = FindNodeByPos (eventArgs);
                        ArrayList levelLines = new ArrayList ();
                        TreeNode nd = node;
@@ -900,6 +903,7 @@
                
                protected virtual bool LoadPostData (string postDataKey, 
NameValueCollection postCollection)
                {
+                       RequiresDataBinding = true;
                        EnsureDataBound ();
                        
                        bool res = false;

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSourceView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSourceView.cs   
2005-05-26 16:16:29 UTC (rev 45061)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSourceView.cs   
2005-05-26 16:17:00 UTC (rev 45062)
@@ -42,6 +42,7 @@
                ArrayList nodes;
        
                public XmlDataSourceView (XmlDataSource owner, string name, 
XmlNodeList nodes)
+               : base (owner, name)
                {
                        // Why do they pass owner?
                        this.name = name;

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

Reply via email to