Compartir a través de


ExpansionProvider.IsValidKind Method

Determines whether this is valid text for expansion. This method should be overridden if you want to specify where in the source document the expansion can take place.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

'Declaration
Public Overridable Function IsValidKind ( _
    buffer As IVsTextLines, _
    ts As TextSpan(), _
    bstrKind As String, _
    <OutAttribute> ByRef fIsValid As Integer _
) As Integer
public virtual int IsValidKind(
    IVsTextLines buffer,
    TextSpan[] ts,
    string bstrKind,
    out int fIsValid
)
public:
virtual int IsValidKind(
    IVsTextLines^ buffer, 
    array<TextSpan>^ ts, 
    String^ bstrKind, 
    [OutAttribute] int% fIsValid
)
abstract IsValidKind : 
        buffer:IVsTextLines * 
        ts:TextSpan[] * 
        bstrKind:string * 
        fIsValid:int byref -> int  
override IsValidKind : 
        buffer:IVsTextLines * 
        ts:TextSpan[] * 
        bstrKind:string * 
        fIsValid:int byref -> int
public function IsValidKind(
    buffer : IVsTextLines, 
    ts : TextSpan[], 
    bstrKind : String, 
    fIsValid : int
) : int

Parameters

  • bstrKind
    Type: String

    The kind of expansion to perform.

  • fIsValid
    Type: Int32%

    [out] Returns true if it is a valid expansion kind, otherwise false.

Return Value

Type: Int32
When overridden in derived classes, S_OK if the method succeeds, otherwise an error code.

Implements

IVsExpansionClient.IsValidKind(IVsTextLines, array<TextSpan[], String, Int32%)

Remarks

This method by default checks only that buffer is the same as the IVsTextLines of Source; it will throw an ArgumentException if not. Implementers must override this method if they wish to specify where in a document a given expansion can be performed.

.NET Framework Security

See Also

Reference

ExpansionProvider Class

Microsoft.VisualStudio.Package Namespace