Provides a strongly typed collection for System.Web.SiteMapNode objects and implements the System.Web.UI.IHierarchicalEnumerable interface to support navigating through the collection.
See Also: SiteMapNodeCollection Members
The System.Web.SiteMapNodeCollection class provides a strongly typed collection for System.Web.SiteMapNode objects. It stores System.Web.SiteMapNode objects internally in a zero-based array.
You can modify a System.Web.SiteMapNodeCollection collection when it is first created, and then use the following methods to add, copy, and remove System.Web.SiteMapNode objects:
To add System.Web.SiteMapNode objects, use the SiteMapNodeCollection.Add(SiteMapNode), erload:System.Web.SiteMapNodeCollection.AddRange, and SiteMapNodeCollection.Insert(int, SiteMapNode) methods.
To copy System.Web.SiteMapNode objects, use the SiteMapNodeCollection.CopyTo(SiteMapNode[], int) method.
To remove System.Web.SiteMapNode objects, use the SiteMapNodeCollection.Remove(SiteMapNode) method.
You can create a read-only System.Web.SiteMapNodeCollection, which does not permit adding, copying, nor removing System.Web.SiteMapNode objects, by using the static SiteMapNodeCollection.ReadOnly(SiteMapNodeCollection) method. The System.Web.SiteMapNodeCollection collections that are returned by the SiteMapNode.GetAllNodes and System.Web.UI.IHierarchyData.GetChildren methods are read-only, as is the System.Web.SiteMapNodeCollection that is returned when the SiteMapNode.ChildNodes property is accessed on a System.Web.SiteMapNode object that is returned from a provider. A NotSupportedException exception is thrown, if you attempt to modify a read-only System.Web.SiteMapNodeCollection by setting the default indexer property or by using any of the following methods:
Use the SiteMapNodeCollection.IsReadOnly property to check the collection before calling any of the methods in the preceding list.