Partager via


IVsExpansionClient.IsValidKind Method

Called to verify that the specified location can accept the specified kind of snippet.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Syntax

'Declaration
Function IsValidKind ( _
    pBuffer As IVsTextLines, _
    ts As TextSpan(), _
    bstrKind As String, _
    <OutAttribute> ByRef pfIsValidKind As Integer _
) As Integer
int IsValidKind(
    IVsTextLines pBuffer,
    TextSpan[] ts,
    string bstrKind,
    out int pfIsValidKind
)
int IsValidKind(
    [InAttribute] IVsTextLines^ pBuffer, 
    [InAttribute] array<TextSpan>^ ts, 
    [InAttribute] String^ bstrKind, 
    [OutAttribute] int% pfIsValidKind
)
abstract IsValidKind : 
        pBuffer:IVsTextLines * 
        ts:TextSpan[] * 
        bstrKind:string * 
        pfIsValidKind:int byref -> int
function IsValidKind(
    pBuffer : IVsTextLines, 
    ts : TextSpan[], 
    bstrKind : String, 
    pfIsValidKind : int
) : int

Parameters

  • bstrKind
    Type: System.String

    [in] A string that specifies the kind of code snippet that is to be inserted. See Remarks.

  • pfIsValidKind
    Type: System.Int32%

    [out] Non-zero (TRUE) if the code snippet can be inserted into the specified location based on its kind; zero (FALSE) if the code snippet cannot be inserted.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr2.idl:

bool IVsExpansionClient::IsValidKind(
   [in]IVsTextLines *pBuffer,
   [in]TextSpan *ts,
   [in]BSTR bstrKind
);

The bstrKind parameter is a string that specifies the kinds of snippets to display, such as MethodBody, Page, and File. The snippet kind can control in what context the snippet is inserted. For example, a snippet kind of MethodBody should be inserted only in a method. See Code Element (IntelliSense Code Snippets) for a list of all snippet kinds that are supported. It is possible for a code snippet to not have a kind associated with it in which case the bstrKind parameter is an empty string.

.NET Framework Security

See Also

Reference

IVsExpansionClient Interface

Microsoft.VisualStudio.TextManager.Interop Namespace