Share via


Clase NavigationNodeCollection

Una colección de nodos de exploración.

Jerarquía de la herencia

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.ClientObjectCollection
      Microsoft.SharePoint.Client.ClientObjectCollection<NavigationNode>
        Microsoft.SharePoint.Client.NavigationNodeCollection

Espacio de nombres:  Microsoft.SharePoint.Client
Ensamblados:   Microsoft.SharePoint.Client.Silverlight (en Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (en Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (en Microsoft.SharePoint.Client.dll)

Sintaxis

'Declaración
Public NotInheritable Class NavigationNodeCollection _
    Inherits ClientObjectCollection(Of NavigationNode)
'Uso
Dim instance As NavigationNodeCollection
public sealed class NavigationNodeCollection : ClientObjectCollection<NavigationNode>

Ejemplos

Este ejemplo de código agrega un nodo en el área de inicio rápido del sitio especificado y muestra los nodos actuales de inicio rápido.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class NavigationNodeCollectionExample
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;

            // Get the Quick Launch navigation node collection.
            NavigationNodeCollection collQuickLaunchNode = site.Navigation.QuickLaunch;

            // Set properties for a new navigation node.
            NavigationNodeCreationInformation ciNavicationNode = new NavigationNodeCreationInformation();
            ciNavicationNode.Title = "New Node";
            ciNavicationNode.Url = "https://localhost";
            // Create node as the last node in the collection.
            ciNavicationNode.AsLastNode = true;
            collQuickLaunchNode.Add(ciNavicationNode);

            clientContext.Load(collQuickLaunchNode);
            clientContext.ExecuteQuery();

            Console.WriteLine("Current nodes:\n");
            foreach (NavigationNode navNode in collQuickLaunchNode)
               Console.WriteLine(navNode.Title);
        }
    }
}

Seguridad para subprocesos

Los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para subprocesos. No se garantiza que los miembros de instancias sean seguros para los subprocesos.

Vea también

Referencia

Miembros NavigationNodeCollection

Espacio de nombres Microsoft.SharePoint.Client