UserCustomActionCollection - Classe
Représente une collection d'objets UserCustomAction .
Hiérarchie d’héritage
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.ClientObjectCollection
Microsoft.SharePoint.Client.ClientObjectCollection<UserCustomAction>
Microsoft.SharePoint.Client.UserCustomActionCollection
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 UserCustomActionCollection _
Inherits ClientObjectCollection(Of UserCustomAction)
'Utilisation
Dim instance As UserCustomActionCollection
public sealed class UserCustomActionCollection : ClientObjectCollection<UserCustomAction>
Exemples
Cet exemple de code ajoute un nouvel élément de menu dans le menu Actions du Site du site spécifié.
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.");
}
}
}
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.