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
'Declaração
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
- pBuffer
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextLines
[in] An IVsTextLines object that represents the text buffer where the code snippet is to be inserted.
- ts
Type: array<Microsoft.VisualStudio.TextManager.Interop.TextSpan[]
[in] A TextSpan object that describes the location where the code snippet is to be inserted.
- 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.