Partilhar via


ContentTypeCollection.AddExistingContentType Method

Adds the specified content type to the collection.

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Function AddExistingContentType ( _
    contentType As ContentType _
) As ContentType
'Usage
Dim instance As ContentTypeCollection
Dim contentType As ContentType
Dim returnValue As ContentType

returnValue = instance.AddExistingContentType(contentType)
[RemoteAttribute]
public ContentType AddExistingContentType(
    ContentType contentType
)

Parameters

Return Value

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.

Remarks

The name of the given content type must not be the same as any of the content types in the collection.

See Also

Reference

ContentTypeCollection Class

ContentTypeCollection Members

Microsoft.SharePoint.Client Namespace