NavigationNode 类
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.
继承层次结构
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.NavigationNode
命名空间: Microsoft.SharePoint.Client
程序集: Microsoft.SharePoint.Client.Silverlight(位于 Microsoft.SharePoint.Client.Silverlight.dll 中); Microsoft.SharePoint.Client.Phone(位于 Microsoft.SharePoint.Client.Phone.dll 中) Microsoft.SharePoint.Client(位于 Microsoft.SharePoint.Client.dll 中)
语法
声明
Public NotInheritable Class NavigationNode _
Inherits ClientObject
用法
Dim instance As NavigationNode
public sealed class NavigationNode : ClientObject
示例
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);
}
}
}
线程安全性
该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。