Call SetEndOfSendNotification
[mono.git] / mcs / class / System.Web / System.Web / SiteMapNode.cs
index 27692edde6b63f5e374bf94ac6900fce7405a364..e1fb52011f9f6017f96a3eb4f6ee86fbda1e9d2f 100644 (file)
@@ -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
+