Condividi tramite


CompletionSet.GetBestMatch(String, Int32, Int32, UInt32) Method

Definition

Determines which item in the list is the best match for the text typed so far by the user.

public:
 virtual int GetBestMatch(System::String ^ textSoFar, int length, [Runtime::InteropServices::Out] int % index, [Runtime::InteropServices::Out] System::UInt32 % flags);
 virtual int GetBestMatch(std::wstring const & textSoFar, int length, [Runtime::InteropServices::Out] int & index, [Runtime::InteropServices::Out] unsigned int & flags);
public virtual int GetBestMatch (string textSoFar, int length, out int index, out uint flags);
abstract member GetBestMatch : string * int * int * uint32 -> int
override this.GetBestMatch : string * int * int * uint32 -> int
Public Overridable Function GetBestMatch (textSoFar As String, length As Integer, ByRef index As Integer, ByRef flags As UInteger) As Integer

Parameters

textSoFar
String

[in] The text that has been typed by the user.

length
Int32

[in] The length of the text typed by the user.

index
Int32

[out] Returns the index of the item in the Declarations object that best matches the typed text.

flags
UInt32

[out] Returns a set of flags from the UpdateCompletionFlags enumeration.

Returns

If successful, returns S_OK; otherwise, returns an error code.

Implements

Remarks

This method is an implementation of the GetBestMatch method on the IVsCompletionSet interface.

If textSoFar is not empty, the base method calls the GetBestMatch method on the Declarations object that was passed to the Init method; otherwise, if there is only one item in the Declarations list then that entry is used. If a match is found, the flags parameter is set to GBM_SELECT and if the match is unique (that is, there is only match in the list) then the flag GBM_UNIQUE is added to the flags parameter. The base method always returns a success code of S_OK.

Applies to