Freigeben über


NavigationNode-Klasse

Steht für die URL eines bestimmten Navigationsknotens und bietet Zugriff auf Eigenschaften und Methoden zum Ändern der Sortierung des Navigationsknotens in einer Navigationsknotenauflistung.

Vererbungshierarchie

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

Namespace:  Microsoft.SharePoint.Client
Assemblys:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (in Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public NotInheritable Class NavigationNode _
    Inherits ClientObject
'Usage
Dim instance As NavigationNode
public sealed class NavigationNode : ClientObject

Beispiele

In diesem Codebeispiel im Schnellstartbereich der angegebenen Website ein Knoten hinzugefügt und zeigt die aktuellen Schnellstartleiste Knoten.

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);
        }
    }
}

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Die Threadsicherheit von Instanzmembern ist nicht gewährleistet.

Siehe auch

Referenz

NavigationNode-Member

Microsoft.SharePoint.Client-Namespace