共用方式為


IClassificationTypeRegistryService.CreateClassificationType 方法

初始化 IClassificationType 的新執行個體,並將其加入至登錄中。

命名空間:  Microsoft.VisualStudio.Text.Classification
組件:  Microsoft.VisualStudio.Text.Logic (在 Microsoft.VisualStudio.Text.Logic.dll 中)

語法

'宣告
Function CreateClassificationType ( _
    type As String, _
    baseTypes As IEnumerable(Of IClassificationType) _
) As IClassificationType
IClassificationType CreateClassificationType(
    string type,
    IEnumerable<IClassificationType> baseTypes
)
IClassificationType^ CreateClassificationType(
    String^ type, 
    IEnumerable<IClassificationType^>^ baseTypes
)
abstract CreateClassificationType : 
        type:string * 
        baseTypes:IEnumerable<IClassificationType> -> IClassificationType
function CreateClassificationType(
    type : String, 
    baseTypes : IEnumerable<IClassificationType>
) : IClassificationType

參數

  • type
    類型:String

    要建立之分類型別的名稱。

傳回值

類型:Microsoft.VisualStudio.Text.Classification.IClassificationType
新的 IClassificationType

例外狀況

例外狀況 條件
InvalidOperationException

type已在登錄中。

.NET Framework 安全性

請參閱

參考

IClassificationTypeRegistryService 介面

Microsoft.VisualStudio.Text.Classification 命名空間