UserCustomActionCollection classe
Representa uma coleção de objetos UserCustomAction .
Inheritance hierarchy
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.ClientObjectCollection
Microsoft.SharePoint.Client.ClientObjectCollection<UserCustomAction>
Microsoft.SharePoint.Client.UserCustomActionCollection
Namespace: Microsoft.SharePoint.Client
Assemblies: Microsoft.SharePoint.Client.Silverlight (em Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client.Phone (em Microsoft.SharePoint.Client.Phone.dll) Microsoft.SharePoint.Client (em Microsoft.SharePoint.Client.dll)
Sintaxe
'Declaração
Public NotInheritable Class UserCustomActionCollection _
Inherits ClientObjectCollection(Of UserCustomAction)
'Uso
Dim instance As UserCustomActionCollection
public sealed class UserCustomActionCollection : ClientObjectCollection<UserCustomAction>
Exemplos
Este exemplo de código adiciona um novo item de menu para o menu Ações do Site do site especificado.
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.");
}
}
}
Segurança de thread
Os membros públicos estática (Shared no Visual Basic) desse tipo são seguros para thread. Nenhum membro de instância pode ser garantido como seguro para thread.