Compartilhar via


NavigationNodeCollection classe

Uma coleção de nós de navegação.

Inheritance hierarchy

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

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (em Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (em Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (em Microsoft.SharePoint.Client.dll)

Sintaxe

'Declaração
Public NotInheritable Class NavigationNodeCollection _
    Inherits ClientObjectCollection(Of NavigationNode)
'Uso
Dim instance As NavigationNodeCollection
public sealed class NavigationNodeCollection : ClientObjectCollection<NavigationNode>

Exemplos

Este exemplo de código adiciona um nó para a área de início rápido do site especificado e exibe os nós atuais de início 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);
        }
    }
}

Segurança de thread

Os membros públicos estática (Shared no Visual Basic) desse tipo são seguros para thread. Nenhum membro de instância pode ser garantido como seguro para thread.

Ver também

Referência

NavigationNodeCollection membros

Microsoft.SharePoint.Client namespace