IContentTypeRegistryService.AddContentType Method (String, IEnumerable<String>)

 

Creates and adds a new content type.

Namespace:   Microsoft.VisualStudio.Utilities
Assembly:  Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)

IContentType AddContentType(
	string typeName,
	IEnumerable<string> baseTypeNames
)

Parameters

typeName
Type: System.String

The name of the content type.

baseTypeNames
Type: System.Collections.Generic.IEnumerable<String>

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

Exception Condition
InvalidOperationException

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.

ArgumentException

typeName is null or empty.

Return to top
Show: