ExpansionProvider.IsValidType Method

Determines whether or not a given type is valid for expansion purposes. 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.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

‘선언
Public Overridable Function IsValidType ( _
    buffer As IVsTextLines, _
    ts As TextSpan(), _
    rgTypes As String(), _
    iCountTypes As Integer, _
    <OutAttribute> ByRef fIsValid As Integer _
) As Integer
‘사용 방법
Dim instance As ExpansionProvider
Dim buffer As IVsTextLines
Dim ts As TextSpan()
Dim rgTypes As String()
Dim iCountTypes As Integer
Dim fIsValid As Integer
Dim returnValue As Integer

returnValue = instance.IsValidType(buffer, _
    ts, rgTypes, iCountTypes, fIsValid)
public virtual int IsValidType(
    IVsTextLines buffer,
    TextSpan[] ts,
    string[] rgTypes,
    int iCountTypes,
    out int fIsValid
)
public:
virtual int IsValidType(
    IVsTextLines^ buffer, 
    array<TextSpan>^ ts, 
    array<String^>^ rgTypes, 
    int iCountTypes, 
    [OutAttribute] int% fIsValid
)
abstract IsValidType : 
        buffer:IVsTextLines * 
        ts:TextSpan[] * 
        rgTypes:string[] * 
        iCountTypes:int * 
        fIsValid:int byref -> int 
override IsValidType : 
        buffer:IVsTextLines * 
        ts:TextSpan[] * 
        rgTypes:string[] * 
        iCountTypes:int * 
        fIsValid:int byref -> int 
public function IsValidType(
    buffer : IVsTextLines, 
    ts : TextSpan[], 
    rgTypes : String[], 
    iCountTypes : int, 
    fIsValid : int
) : int

Parameters

  • rgTypes
    Type: array<System.String[]
    An array of expansion types.
  • iCountTypes
    Type: System.Int32
    The number of expansion types in the rgTypes array.
  • fIsValid
    Type: System.Int32%
    [out] Returns true if the type is valid, otherwise false.

Return Value

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

Implements

IVsExpansionClient.IsValidType(IVsTextLines, array<TextSpan[], array<String[], Int32, 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

ExpansionProvider Members

Microsoft.VisualStudio.Package Namespace