SiteMapNodeItemType 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
SiteMapNodeItemType 열거형은 SiteMapPath 컨트롤에서 노드 계층 내의 SiteMapNodeItem 노드 유형을 식별하는 데 사용됩니다.
public enum class SiteMapNodeItemType
public enum SiteMapNodeItemType
type SiteMapNodeItemType =
Public Enum SiteMapNodeItemType
- 상속
필드
| Name | 값 | Description |
|---|---|---|
| Root | 0 | 사이트 탐색 계층의 최상위 노드입니다. 루트 노드는 하나만 있을 수 있습니다. |
| Parent | 1 | 사이트 탐색 경로에서 현재 본 페이지의 부모 노드입니다. 부모 노드는 탐색 계층의 루트 노드와 현재 노드 사이에 있는 모든 노드입니다. |
| Current | 2 | 사이트 탐색 경로에서 현재 본 페이지입니다. |
| PathSeparator | 3 | 사이트 맵 탐색 경로 구분 기호입니다. 컨트롤의 SiteMapPath 기본 구분 기호는 ">" 문자입니다. |
예제
다음 예제에서는 메서드 내에서 SiteMapPath.OnItemCreated 만든 후 메서드를 호출 SiteMapNodeItem 하는 SiteMapPath.InitializeItem 방법을 보여 줍니다. 이 예제는 클래스에 제공된 더 큰 예제의 SiteMapPath 일부입니다.
private void AddDropDownListAfterCurrentNode(SiteMapNodeItem item) {
SiteMapNodeCollection childNodes = item.SiteMapNode.ChildNodes;
// Only do this work if there are child nodes.
if (childNodes != null) {
// Add another PathSeparator after the CurrentNode.
SiteMapNodeItem finalSeparator =
new SiteMapNodeItem(item.ItemIndex,
SiteMapNodeItemType.PathSeparator);
SiteMapNodeItemEventArgs eventArgs =
new SiteMapNodeItemEventArgs(finalSeparator);
InitializeItem(finalSeparator);
// Call OnItemCreated every time a SiteMapNodeItem is
// created and initialized.
OnItemCreated(eventArgs);
// The pathSeparator does not bind to any SiteMapNode, so
// do not call DataBind on the SiteMapNodeItem.
item.Controls.Add(finalSeparator);
// Create a DropDownList and populate it with the children of the
// CurrentNode. There are no styles or templates that are applied
// to the DropDownList control. If OnSelectedIndexChanged is raised,
// the event handler redirects to the page selected.
// The CurrentNode has child nodes.
DropDownList ddList = new DropDownList();
ddList.AutoPostBack = true;
ddList.SelectedIndexChanged += new EventHandler(this.DropDownNavPathEventHandler);
// Add a ListItem to the DropDownList for every node in the
// SiteMapNodes collection.
foreach (SiteMapNode node in childNodes) {
ddList.Items.Add(new ListItem(node.Title, node.Url));
}
item.Controls.Add(ddList);
}
}
Private Sub AddDropDownListAfterCurrentNode(item As SiteMapNodeItem)
Dim childNodes As SiteMapNodeCollection = item.SiteMapNode.ChildNodes
' Only do this work if there are child nodes.
If Not (childNodes Is Nothing) Then
' Add another PathSeparator after the CurrentNode.
Dim finalSeparator As New SiteMapNodeItem(item.ItemIndex, SiteMapNodeItemType.PathSeparator)
Dim eventArgs As New SiteMapNodeItemEventArgs(finalSeparator)
InitializeItem(finalSeparator)
' Call OnItemCreated every time a SiteMapNodeItem is
' created and initialized.
OnItemCreated(eventArgs)
' The pathSeparator does not bind to any SiteMapNode, so
' do not call DataBind on the SiteMapNodeItem.
item.Controls.Add(finalSeparator)
' Create a DropDownList and populate it with the children of the
' CurrentNode. There are no styles or templates that are applied
' to the DropDownList control. If OnSelectedIndexChanged is raised,
' the event handler redirects to the page selected.
' The CurrentNode has child nodes.
Dim ddList As New DropDownList()
ddList.AutoPostBack = True
AddHandler ddList.SelectedIndexChanged, AddressOf Me.DropDownNavPathEventHandler
' Add a ListItem to the DropDownList for every node in the
' SiteMapNodes collection.
Dim node As SiteMapNode
For Each node In childNodes
ddList.Items.Add(New ListItem(node.Title, node.Url))
Next node
item.Controls.Add(ddList)
End If
End Sub
설명
컨트롤은 SiteMapPath 해당 사이트 탐색 정보를 개체 컬렉션 SiteMapNodeItem 으로 관리합니다. SiteMapNodeItem 개체는 기능적으로 다른 유형의 SiteMapNode 노드를 나타냅니다. 따라서 컨트롤에 SiteMapPath 의해 관리됩니다. 다음 목록에서는 사용 가능한 노드 유형에 대해 설명합니다.
현재 본 페이지를 나타내는 하나의 노드입니다.
사이트 탐색 계층 구조의 최상위 노드인 하나의 노드입니다.
상위 노드와 현재 노드(부모 노드) 사이에 0개 이상의 노드가 있습니다.
사이트 탐색 경로 구분 기호를 나타내는 노드가 0개 이상입니다.
각 노드는 PathSeparator 형식의 노드를 SiteMapNode제외하고 기본 노드에 데이터 바인딩됩니다.