Partager via


NavigationNode - Classe

Represents the URL to a specific navigation node and provides access to properties and methods for manipulating the ordering of the navigation node in a navigation node collection.

Hiérarchie d’héritage

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.NavigationNode

Espace de noms :  Microsoft.SharePoint.Client
Assemblys :   Microsoft.SharePoint.Client.Silverlight (dans Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (dans Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)

Syntaxe

'Déclaration
Public NotInheritable Class NavigationNode _
    Inherits ClientObject
'Utilisation
Dim instance As NavigationNode
public sealed class NavigationNode : ClientObject

Exemples

This code example adds a node to the Quick Launch area of the specified site and displays the current Quick Launch nodes.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class NavigationNodeExample
    {
        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);
        }
    }
}

Cohérence de thread

Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.

Voir aussi

Référence

NavigationNode - Membres

Microsoft.SharePoint.Client - Espace de noms