다음을 통해 공유


CompletionSet.CompareItems Method

Compares two strings for the specified number of characters.

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

Syntax

'Declaration
Public Overridable Function CompareItems ( _
    bstrSoFar As String, _
    bstrOther As String, _
    lCharactersToCompare As Integer, _
    <OutAttribute> ByRef plResult As Integer _
) As Integer
public virtual int CompareItems(
    string bstrSoFar,
    string bstrOther,
    int lCharactersToCompare,
    out int plResult
)
public:
virtual int CompareItems(
    String^ bstrSoFar, 
    String^ bstrOther, 
    int lCharactersToCompare, 
    [OutAttribute] int% plResult
)
abstract CompareItems : 
        bstrSoFar:string * 
        bstrOther:string * 
        lCharactersToCompare:int * 
        plResult:int byref -> int  
override CompareItems : 
        bstrSoFar:string * 
        bstrOther:string * 
        lCharactersToCompare:int * 
        plResult:int byref -> int
public function CompareItems(
    bstrSoFar : String, 
    bstrOther : String, 
    lCharactersToCompare : int, 
    plResult : int
) : int

Parameters

  • bstrSoFar
    Type: String

    The first string to compare.

  • bstrOther
    Type: String

    The second string to compare.

  • lCharactersToCompare
    Type: Int32

    The number of characters to compare.

  • plResult
    Type: Int32%

    [out] The result of the comparison.

Return Value

Type: Int32
If the method is successful, returns S_OK; otherwise, returns an error code (in which case the default comparison is used).

Implements

IVsCompletionSetEx.CompareItems(String, String, Int32, Int32%)

Remarks

The plResult should be returned as follows: if bstrSoFar comes before bstrOther, plResult < 0. If bstrSoFar is equivalent to bstrOther, plResult is 0. If bstrSoFar comes after bstrOther, plResult > 0.

This method is the implementation of the CompareItems method of the IVsCompletionSetEx interface.

By default this method is not implemented and returns plResult as 0 and E_NOTIMPL.

.NET Framework Security

See Also

Reference

CompletionSet Class

Microsoft.VisualStudio.Package Namespace