Compartir a través de


IContentTypeRegistryService.AddContentType Method

Definition

Creates and adds a new content type.

public:
 Microsoft::VisualStudio::Utilities::IContentType ^ AddContentType(System::String ^ typeName, System::Collections::Generic::IEnumerable<System::String ^> ^ baseTypeNames);
public Microsoft.VisualStudio.Utilities.IContentType AddContentType (string typeName, System.Collections.Generic.IEnumerable<string> baseTypeNames);
abstract member AddContentType : string * seq<string> -> Microsoft.VisualStudio.Utilities.IContentType
Public Function AddContentType (typeName As String, baseTypeNames As IEnumerable(Of String)) As IContentType

Parameters

typeName
String

The name of the content type.

baseTypeNames
IEnumerable<String>

The list of content type names to be used as base content types. Optional.

Returns

The IContentType.

Exceptions

typeName is null or empty.

typeName or one of the baseTypeNames is the name of UnknownContentType, or the content type already exists, or one of the base types would introduce a cyclic base type relationship.

Applies to