IContentTypeRegistryService.AddContentType 方法

定义

创建并添加新的内容类型。

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

参数

typeName
String

内容类型的名称。

baseTypeNames
IEnumerable<String>

要用作基内容类型的内容类型名称的列表。 可选。

返回

IContentType

IContentType

例外

typeName 为 null 或为空。

typeName 或者其中一个 baseTypeNames 是的名称 UnknownContentType ,或者内容类型已经存在,或者其中一个基类型会引入循环基类型关系。

适用于