Freigeben über


IVsExpansionClient.IsValidType Method

Called to verify that the specified location can accept the specified types of code snippets.

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

Syntax

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

Parameters

  • rgTypes
    Type: array<System.String[]
    [in] An array strings specifying the types of the code snippet to be inserted. This can be a null value if iCountTypes is 0. See Remarks.
  • iCountTypes
    Type: System.Int32
    [in] The number of types specified in the rgTypes array.
  • pfIsValidType
    Type: System.Int32%
    [out] Non-zero (TRUE) if the code snippet can be inserted into the specified location based on its types; 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::IsValidType(
   [in]IVsTextLines *pBuffer,
   [in]TextSpan *ts,
   [in, size_is(iCountTypes)]BSTR* rgTypes,
   [in] int iCountTypes
);

The rgTypes list contains strings that specify the types of snippets to display. These types can be "Expansion" or "SurroundsWith" (see SnippetType Element (IntelliSense Code Snippets) for details on snippet types). It is possible for a code snippet to not have a type associated with it, in which case the iCountTypes parameter is 0.

.NET Framework Security

See Also

Reference

IVsExpansionClient Interface

Microsoft.VisualStudio.TextManager.Interop Namespace