Compares two strings for the specified number of characters.
Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'宣言
Public Overridable Function CompareItems ( _
bstrSoFar As String, _
bstrOther As String, _
lCharactersToCompare As Integer, _
<OutAttribute> ByRef plResult As Integer _
) As Integer
'使用
Dim instance As CompletionSet
Dim bstrSoFar As String
Dim bstrOther As String
Dim lCharactersToCompare As Integer
Dim plResult As Integer
Dim returnValue As Integer
returnValue = instance.CompareItems(bstrSoFar, _
bstrOther, lCharactersToCompare, _
plResult)
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
)
public function CompareItems(
bstrSoFar : String,
bstrOther : String,
lCharactersToCompare : int,
plResult : int
) : int
Parameters
bstrSoFar
Type: System.StringThe first string to compare.
bstrOther
Type: System.StringThe second string to compare.
lCharactersToCompare
Type: System.Int32The number of characters to compare.
plResult
Type: System.Int32%[out] The result of the comparison.
Return Value
Type: System.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().
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.