IContentTypeRegistryService.AddContentType Method

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.

ExceptionCondition
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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft