Compartir a través de


Declarations.IsMatch Method

Determines whether the specified text matches some or all of the specified item.

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

Syntax

'Declaration
Public Overridable Function IsMatch ( _
    textSoFar As String, _
    index As Integer _
) As Boolean
public virtual bool IsMatch(
    string textSoFar,
    int index
)
public:
virtual bool IsMatch(
    String^ textSoFar, 
    int index
)
abstract IsMatch : 
        textSoFar:string * 
        index:int -> bool  
override IsMatch : 
        textSoFar:string * 
        index:int -> bool
public function IsMatch(
    textSoFar : String, 
    index : int
) : boolean

Parameters

  • textSoFar
    Type: String

    [in] A string containing the text typed by the user and to be matched.

  • index
    Type: Int32

    [in] The index of the item to compare against.

Return Value

Type: Boolean
Returns true if the specified text is at the beginning of the specified item; otherwise, returns false.

Remarks

This method is typically called by the GetBestMatch method to help find the best match for the text typed by the user.

The base method does a case-insensitive compare (using the String.Compare method) between the given text and the name of the given list item (as returned from a call to the GetName method), returning true if the item in the list begins with or exactly matches the given text.

.NET Framework Security

See Also

Reference

Declarations Class

Microsoft.VisualStudio.Package Namespace