UserCustomActionCollection クラス
UserCustomActionオブジェクトのコレクションを表します。
継承階層
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.ClientObjectCollection
Microsoft.SharePoint.Client.ClientObjectCollection<UserCustomAction>
Microsoft.SharePoint.Client.UserCustomActionCollection
名前空間: 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 UserCustomActionCollection _
Inherits ClientObjectCollection(Of UserCustomAction)
'使用
Dim instance As UserCustomActionCollection
public sealed class UserCustomActionCollection : ClientObjectCollection<UserCustomAction>
例
この例では、指定したサイトのサイトの操作] メニューに新しいメニュー項目を追加します。
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class UserCustomActionCollectionExample
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
UserCustomActionCollection collUCA = site.UserCustomActions;
UserCustomAction newUCA = collUCA.Add();
newUCA.Location = "Microsoft.SharePoint.StandardMenu";
newUCA.Group = "SiteActions";
newUCA.Sequence = 1000;
newUCA.Title = "New Menu Item";
newUCA.ImageUrl = "/_layouts/images/myIcon.jpg";
newUCA.Description = "Menu item added";
newUCA.Url = "/_layouts/create.aspx";
newUCA.Update();
clientContext.ExecuteQuery();
Console.WriteLine("New menu item added to Site Actions menu.\n\nTo view the new menu item, refresh the page.");
}
}
}
スレッド セーフ
この型のパブリック static (Visual Basic のShared ) メンバーはいずれもスレッド セーフです。インスタンス メンバーはスレッド セーフになるという保証はありません。