Condividi tramite


IVsCompletionSet.GetBestMatch Method

Determines the index of the closest matching completion set, given what has been typed so far.

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

Syntax

'Dichiarazione
Function GetBestMatch ( _
    pszSoFar As String, _
    iLength As Integer, _
    <OutAttribute> ByRef piIndex As Integer, _
    <OutAttribute> ByRef pdwFlags As UInteger _
) As Integer
int GetBestMatch(
    string pszSoFar,
    int iLength,
    out int piIndex,
    out uint pdwFlags
)
int GetBestMatch(
    [InAttribute] String^ pszSoFar, 
    [InAttribute] int iLength, 
    [OutAttribute] int% piIndex, 
    [OutAttribute] unsigned int% pdwFlags
)
abstract GetBestMatch : 
        pszSoFar:string * 
        iLength:int * 
        piIndex:int byref * 
        pdwFlags:uint32 byref -> int 
function GetBestMatch(
    pszSoFar : String, 
    iLength : int, 
    piIndex : int, 
    pdwFlags : uint
) : int

Parameters

  • pszSoFar
    Type: System.String
    [in] A string containing the text typed by the user.
  • iLength
    Type: System.Int32
    [in] Integer containing the length of the string.
  • piIndex
    Type: System.Int32%
    [out] Returns an integer specifying the index.

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 textmgr.idl:

HRESULT IVsCompletionSet::GetBestMatch(
   [in] const WCHAR *pszSoFar,
   [in] long iLength,
   [out] long *piIndex,
   [out] DWORD *pdwFlags
);

Implement this method to determine the closest matching completion for a word given the text typed by the user. The view calls this method and passes in a string containing the text and the length of the string. In response to this call, return an index position into the completion set that identifies the best match, and a flag identifying the type of match performed.

The view calls this method only if CSF_CUSTOMMATCHING is specified in the completion set's flags.

If pdwFlags is set to either GBM_SELECT or GBM_UNIQUE, then the default matching in the view uses case-sensitive comparison.

.NET Framework Security

See Also

Reference

IVsCompletionSet Interface

Microsoft.VisualStudio.TextManager.Interop Namespace