共用方式為


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),僅擷取捷徑名稱的每個程式碼片段。 否則,零 (FALSE) 來擷取所有的資訊。

  • bstrTypes
    類型:array<String[]

    [in]陣列字串來取得指定的程式碼片段型別。 這可以是 null 值,如果iCountTypes為 0。 請參閱<備註>。

  • iCountTypes
    類型:Int32

    [in]型別中所指定的數字bstrTypes陣列。 如果這是 0,則會傳回所有的型別。

  • fIncludeNULLType
    類型:Int32

    [in]非零 (TRUE) 包含使用中的 「 空白 」 類型的程式碼片段的 if 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 程式碼片段)