本文整理汇总了VB.NET中System.Web.SiteMapNodeCollection.SiteMapNodeCollection构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET SiteMapNodeCollection构造函数的具体用法?VB.NET SiteMapNodeCollection怎么用?VB.NET SiteMapNodeCollection使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。您也可以进一步了解该构造函数所在类System.Web.SiteMapNodeCollection
的用法示例。
在下文中一共展示了SiteMapNodeCollection构造函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: LoadSiteMapData
' The LoadSiteMapData() Function loads site navigation
' data from persistent storage into a DataTable.
Dim siteMapData As DataTable
siteMapData = LoadSiteMapData()
' Create a SiteMapNodeCollection.
Dim nodes As New SiteMapNodeCollection()
' Create a SiteMapNode and add it to the collection.
Dim tempNode As SiteMapNode
Dim row As DataRow
Dim index As Integer
index = 0
While (index < siteMapData.Rows.Count)
row = siteMapData.Rows(index)
' Create a node based on the data in the DataRow.
tempNode = New SiteMapNode(SiteMap.Provider, row("Key").ToString(), row("Url").ToString())
' Add the node to the collection.
nodes.Add(tempNode)
index = index + 1
End While
示例2: SiteMapNodeCollection
' Create a SiteMapNodeCollection with all the nodes
' from the first two hierarchical levels of the current
' site map.
Dim baseCollection As SiteMapNodeCollection
baseCollection = New SiteMapNodeCollection(SiteMap.RootNode)
Dim childCollection As SiteMapNodeCollection = SiteMap.RootNode.ChildNodes
baseCollection.AddRange(childCollection)
Response.Write( "<BR>Derived SiteMapNodeCollection.<BR><HR><BR>")
For Each node In baseCollection
Response.Write( node.Title + "<BR>")
Next
示例3: SiteMapNodeCollection
Dim siteNodes As SiteMapNodeCollection
siteNodes = SiteMap.RootNode.GetAllNodes()
If siteNodes.IsReadOnly Or siteNodes.IsFixedSize Then
Response.Write("Collection is read-only or has fixed size.<BR>")
' Create a new, modifiable collection from the existing one.
Dim modifiableCollection As SiteMapNodeCollection
modifiableCollection = New SiteMapNodeCollection(siteNodes)
' The MoveNode example method moves a node from position one to
' the last position in the collection.
MoveNode(modifiableCollection)
Else
MoveNode(siteNodes)
End If