IContentTypeRegistryService.AddContentType Method
Creates and adds a new content type.
Namespace: Microsoft.VisualStudio.Utilities
Assembly: Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)
Syntax
'Déclaration
Function AddContentType ( _
typeName As String, _
baseTypeNames As IEnumerable(Of String) _
) As IContentType
IContentType AddContentType(
string typeName,
IEnumerable<string> baseTypeNames
)
IContentType^ AddContentType(
String^ typeName,
IEnumerable<String^>^ baseTypeNames
)
abstract AddContentType :
typeName:string *
baseTypeNames:IEnumerable<string> -> IContentType
function AddContentType(
typeName : String,
baseTypeNames : IEnumerable<String>
) : IContentType
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.
Return Value
Type: Microsoft.VisualStudio.Utilities.IContentType
The IContentType.
Exceptions
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 nulla null reference (Nothing in Visual Basic) or empty. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.