Condividi tramite


Declarations.GetBestMatch(String, Int32, Boolean) Method

Definition

Determines the best completion match for the specified value.

public:
 virtual void GetBestMatch(System::String ^ value, [Runtime::InteropServices::Out] int % index, [Runtime::InteropServices::Out] bool % uniqueMatch);
 virtual void GetBestMatch(std::wstring const & value, [Runtime::InteropServices::Out] int & index, [Runtime::InteropServices::Out] bool & uniqueMatch);
public virtual void GetBestMatch (string value, out int index, out bool uniqueMatch);
abstract member GetBestMatch : string * int * bool -> unit
override this.GetBestMatch : string * int * bool -> unit
Public Overridable Sub GetBestMatch (value As String, ByRef index As Integer, ByRef uniqueMatch As Boolean)

Parameters

value
String

[in] The text to match against. This typically represents the text typed by the user.

index
Int32

[out] Returns the index of the item that best matches the value.

uniqueMatch
Boolean

[out] Returns true if the best match is the only match and it matches the value exactly; otherwise, returns false.

Remarks

This method is typically called from the GetBestMatch method in the CompletionSet class to determine which item in the IntelliSense completion list to highlight as characters are typed.

The base method calls the IsMatch method to look for a match. A unique match is indicated if the next item in the list does not match or the search is at the end of the list. If no match is found, index is set to the number of items in the list and uniqueMatch is set to true. If value is null or empty, a COMException exception is thrown.

Applies to