IVsExpansionManager.EnumerateExpansions 方法

检索代码段列表指定的代码的语言。

命名空间:  Microsoft.VisualStudio.TextManager.Interop
程序集:  Microsoft.VisualStudio.TextManager.Interop.8.0(在 Microsoft.VisualStudio.TextManager.Interop.8.0.dll 中)

语法

声明
Function EnumerateExpansions ( _
    guidLang As Guid, _
    fShortCutOnly As Integer, _
    bstrTypes As String(), _
    iCountTypes As Integer, _
    fIncludeNULLType As Integer, _
    fIncludeDuplicates As Integer, _
    <OutAttribute> ByRef pEnum As IVsExpansionEnumeration _
) As Integer
int EnumerateExpansions(
    Guid guidLang,
    int fShortCutOnly,
    string[] bstrTypes,
    int iCountTypes,
    int fIncludeNULLType,
    int fIncludeDuplicates,
    out IVsExpansionEnumeration pEnum
)
int EnumerateExpansions(
    [InAttribute] Guid guidLang, 
    [InAttribute] int fShortCutOnly, 
    [InAttribute] array<String^>^ bstrTypes, 
    [InAttribute] int iCountTypes, 
    [InAttribute] int fIncludeNULLType, 
    [InAttribute] int fIncludeDuplicates, 
    [OutAttribute] IVsExpansionEnumeration^% pEnum
)
abstract EnumerateExpansions : 
        guidLang:Guid * 
        fShortCutOnly:int * 
        bstrTypes:string[] * 
        iCountTypes:int * 
        fIncludeNULLType:int * 
        fIncludeDuplicates:int * 
        pEnum:IVsExpansionEnumeration byref -> int
function EnumerateExpansions(
    guidLang : Guid, 
    fShortCutOnly : int, 
    bstrTypes : String[], 
    iCountTypes : int, 
    fIncludeNULLType : int, 
    fIncludeDuplicates : int, 
    pEnum : IVsExpansionEnumeration
) : int

参数

  • guidLang
    类型:Guid

    [in] 代码的语言的 GUID (通常,这是语言服务的 GUID)。

  • fShortCutOnly
    类型:Int32

    [in] 非零 (TRUE),如果只检索的快捷方式名称每个代码段;否则,检索所有信息零 (0)FALSE)。

  • bstrTypes
    类型:array<String[]

    [in] 数组的字符串指定代码段类型获取。 ,如果 iCountTypes 是 0,则可以为空值。 请参见"备注"。

  • iCountTypes
    类型:Int32

    [in] 在 bstrTypes 数组指定类型的数目。 如果这是 0,所有类型返回。

  • fIncludeNULLType
    类型:Int32

    [in] 非零 (TRUE),如果包括代码段以 “null”输入 bstrTypes 列表 (此参数将被忽略,如果 iCountTypes 为 0)。

  • fIncludeDuplicates
    类型:Int32

    [in] 非零 (TRUE),如果包括重复代码段;否则,重复省略。

返回值

类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 textmgr2.idl:

HRESULT     EnumerateExpansions(
   [in]GUID guidLang,
   [in] bool fShortCutOnly,
   [in, size_is(iCountTypes)] BSTR *bstrTypes,
   [in] long iCountTypes,
   [in] bool fIncludeNULLType,
   [in] bool fIncludeDuplicates,
   [out] IVsExpansionEnumeration **pEnum
);

bstrTypes 列表包含指定代码段的类型检索的字符串。 这些类型可以是 “展开”或 “SurroundsWith” (请参见 SnippetType 元素(IntelliSense 代码段) 有关代码段中类型的详细信息)。 可以为代码段可以没有类型与其关联,在中,此代码段不返回,除非 fIncludeNULLType 参数是非零情况下 (TRUE) 或 iCountTypes 参数为 0。

示例

在参见 IVsExpansionEnumeration 接口主题中的示例会发现此方法如何用于获取所有代码段列表特定代码的语言。

.NET Framework 安全性

请参阅

参考

IVsExpansionManager 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间

其他资源

SnippetType 元素(IntelliSense 代码段)