ContentTypeCollection.AddExistingContentType - Méthode
Adds the specified content type to the collection.
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 Function AddExistingContentType ( _
contentType As ContentType _
) As ContentType
'Utilisation
Dim instance As ContentTypeCollection
Dim contentType As ContentType
Dim returnValue As ContentType
returnValue = instance.AddExistingContentType(contentType)
public ContentType AddExistingContentType(
ContentType contentType
)
Paramètres
contentType
Type : Microsoft.SharePoint.Client.ContentTypeA ContentType object that represents the content type to add to the collection. It must not be une référence Null (Rien dans Visual Basic).
Valeur renvoyée
Type : Microsoft.SharePoint.Client.ContentType
A ContentType object to add to the collection.
Exceptions
Exception | Condition |
---|---|
[ServerException] | The collection is read only. |
[SPException] | A content type with same name as the given content type exists in the collection. |
Remarques
The name of the given content type must not be the same as any of the content types in the collection.