X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web%2FSiteMapNode.cs;h=e1fb52011f9f6017f96a3eb4f6ee86fbda1e9d2f;hb=dff680e41a6368bee2f6a65395b7bfda59c09631;hp=27692edde6b63f5e374bf94ac6900fce7405a364;hpb=2b863d3c26d930546455c0c36b97615acffb9bbc;p=mono.git diff --git a/mcs/class/System.Web/System.Web/SiteMapNode.cs b/mcs/class/System.Web/System.Web/SiteMapNode.cs index 27692edde6b..e1fb52011f9 100644 --- a/mcs/class/System.Web/System.Web/SiteMapNode.cs +++ b/mcs/class/System.Web/System.Web/SiteMapNode.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections; using System.Collections.Specialized; using System.Text; @@ -40,7 +39,7 @@ using System.Resources; namespace System.Web { public class SiteMapNode : IHierarchyData, INavigateUIData, ICloneable { - private SiteMapNode () {} + SiteMapNode () {} public SiteMapNode (SiteMapProvider provider, string key) : this (provider, key, null, null, null, null, null, null, null) {} @@ -92,7 +91,10 @@ namespace System.Web { } public virtual bool HasChildNodes { - get { return ChildNodes != null && ChildNodes.Count != 0; } + get { + SiteMapNodeCollection childNodes = ChildNodes; + return childNodes != null && childNodes.Count > 0; + } } public SiteMapNodeCollection GetAllNodes () @@ -172,11 +174,12 @@ namespace System.Web { parent = value; } } - + public virtual SiteMapNodeCollection ChildNodes { get { - if (childNodes != null) return childNodes; - return provider.GetChildNodes (this); + if (childNodes == null) + childNodes = provider.GetChildNodes (this); + return childNodes; } set { CheckWritable (); @@ -440,5 +443,5 @@ namespace System.Web { } } -#endif +