SiteMapNodeItemType Sabit listesi

Tanım

Numaralandırma SiteMapNodeItemType , denetim tarafından SiteMapPath düğüm hiyerarşisi içindeki bir SiteMapNodeItem düğümün türünü tanımlamak için kullanılır.

public enum class SiteMapNodeItemType
public enum SiteMapNodeItemType
type SiteMapNodeItemType = 
Public Enum SiteMapNodeItemType
Devralma
SiteMapNodeItemType

Alanlar

Current 2

Site gezinti yolunda o anda görüntülenen sayfa.

Parent 1

Site gezinti yolunda o anda görüntülenen sayfanın üst düğümü. Üst düğüm, gezinti hiyerarşisindeki kök düğüm ile geçerli düğüm arasında bulunan herhangi bir düğümdür.

PathSeparator 3

Site haritası gezinti yolu ayırıcısı. Denetimin varsayılan ayırıcısı SiteMapPath ">" karakteridir.

Root 0

Site gezinti hiyerarşisinin en üst düğümü. Yalnızca bir kök düğüm olabilir.

Örnekler

Aşağıdaki örnek, yöntemi içinde bir SiteMapNodeItem oluşturduktan sonra yönteminin SiteMapPath.OnItemCreated nasıl çağrılduğunu SiteMapPath.InitializeItem gösterir. Bu örnek, sınıfı için SiteMapPath sağlanan daha büyük bir örneğin parçasıdır.

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

Açıklamalar

Denetim, SiteMapPath site gezinti bilgilerini bir nesne koleksiyonu SiteMapNodeItem olarak yönetir. SiteMapNodeItem nesneleri işlevsel olarak farklı düğüm türlerini SiteMapNode temsil eder. Buna göre, bunlar denetim tarafından SiteMapPath yönetilir. Aşağıdaki listede kullanılabilir düğüm türleri açıklanmaktadır:

  • Şu anda görüntülenen sayfayı temsil eden bir düğüm.

  • Site gezinti hiyerarşisinin en üst düğümü olan bir düğüm.

  • Üst düğüm ile geçerli düğüm (üst düğümler) arasında sıfır veya daha fazla düğüm.

  • Site gezinti yolu ayırıcılarını temsil eden sıfır veya daha fazla düğüm.

Her düğüm, PathSeparator türündeki düğümler dışında temel alınan SiteMapNodebir öğesine bağlıdır.

Şunlara uygulanır

Ayrıca bkz.