IVsExpansionManager.InvokeInsertionUI 方法

显示 IntelliSense 可插入到源通过提供的 IVsExpansionClient 对象的列表代码段。

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

语法

声明
Function InvokeInsertionUI ( _
    pView As IVsTextView, _
    pClient As IVsExpansionClient, _
    guidLang As Guid, _
    bstrTypes As String(), _
    iCountTypes As Integer, _
    fIncludeNULLType As Integer, _
    bstrKinds As String(), _
    iCountKinds As Integer, _
    fIncludeNULLKind As Integer, _
    bstrPrefixText As String, _
    bstrCompletionChar As String _
) As Integer
int InvokeInsertionUI(
    IVsTextView pView,
    IVsExpansionClient pClient,
    Guid guidLang,
    string[] bstrTypes,
    int iCountTypes,
    int fIncludeNULLType,
    string[] bstrKinds,
    int iCountKinds,
    int fIncludeNULLKind,
    string bstrPrefixText,
    string bstrCompletionChar
)
int InvokeInsertionUI(
    [InAttribute] IVsTextView^ pView, 
    [InAttribute] IVsExpansionClient^ pClient, 
    [InAttribute] Guid guidLang, 
    [InAttribute] array<String^>^ bstrTypes, 
    [InAttribute] int iCountTypes, 
    [InAttribute] int fIncludeNULLType, 
    [InAttribute] array<String^>^ bstrKinds, 
    [InAttribute] int iCountKinds, 
    [InAttribute] int fIncludeNULLKind, 
    [InAttribute] String^ bstrPrefixText, 
    [InAttribute] String^ bstrCompletionChar
)
abstract InvokeInsertionUI : 
        pView:IVsTextView * 
        pClient:IVsExpansionClient * 
        guidLang:Guid * 
        bstrTypes:string[] * 
        iCountTypes:int * 
        fIncludeNULLType:int * 
        bstrKinds:string[] * 
        iCountKinds:int * 
        fIncludeNULLKind:int * 
        bstrPrefixText:string * 
        bstrCompletionChar:string -> int
function InvokeInsertionUI(
    pView : IVsTextView, 
    pClient : IVsExpansionClient, 
    guidLang : Guid, 
    bstrTypes : String[], 
    iCountTypes : int, 
    fIncludeNULLType : int, 
    bstrKinds : String[], 
    iCountKinds : int, 
    fIncludeNULLKind : int, 
    bstrPrefixText : String, 
    bstrCompletionChar : String
) : int

参数

  • guidLang
    类型:Guid

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

  • bstrTypes
    类型:array<String[]

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

  • iCountTypes
    类型:Int32

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

  • fIncludeNULLType
    类型:Int32

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

  • bstrKinds
    类型:array<String[]

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

  • iCountKinds
    类型:Int32

    [in] 在 bstrKinds 数组指定的类型的数目。 如果这是 0,所有类型显示。

  • fIncludeNULLKind
    类型:Int32

    [in] 非零 (TRUE),如果包含 “空”类型的代码段在 bstrKinds 列表 (此参数将被忽略,如果 iCountKinds 为 0)。

  • bstrPrefixText
    类型:String

    [in] 包含文本的字符串显示在提示。

  • bstrCompletionChar
    类型:String

    [in] 字符,那么,当键入,插入当前选定的代码段和结束 UI。 如果这是一个 null 值或为空字符串,键入 enter 键是唯一一种可以插入每个选定的代码段。

返回值

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

备注

COM 签名

从 textmgr2.idl:

HRESULT IVsExpansionManager::InvokeInsertionUI(
   [in] IVsTextView *pView,
   [in]IVsExpansionClient *pClient,
   [in]GUID guidLang,
   [in, size_is(iCountTypes)] BSTR *bstrTypes,
   [in] long iCountTypes,
   [in] bool fIncludeNULLType,
   [in, size_is(iCountKinds)] BSTR *bstrKinds,
   [in] long iCountKinds,
   [in] bool fIncludeNULLKind,
   [in] BSTR bstrPrefixText,
   [in] BSTR bstrCompletionChar
);

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

bstrKinds 列表包含指定该代码段显示,例如 MethodBody, Page的字符串和 File。 代码段类型可能在什么上下文控件插入代码段。 例如,在方法只应插入一个代码段 MethodBody 。 支持所有代码段类型的列表参见 Code 元素(IntelliSense 代码段) 。 可以为代码段可以没有类型与它,,在这些代码段未显示,除非 fIncludeNULLKind 参数是非零情况下 (TRUE) 或 iCountKinds 参数为 0。

.NET Framework 安全性

请参阅

参考

IVsExpansionManager 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间

其他资源

SnippetType 元素(IntelliSense 代码段)

Code 元素(IntelliSense 代码段)