Partager via


Declarations.IsCommitChar Method

Determines whether the specified character can be used to complete the specified text.

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

Syntax

'Declaration
Public Overridable Function IsCommitChar ( _
    textSoFar As String, _
    selected As Integer, _
    commitCharacter As Char _
) As Boolean
public virtual bool IsCommitChar(
    string textSoFar,
    int selected,
    char commitCharacter
)
public:
virtual bool IsCommitChar(
    String^ textSoFar, 
    int selected, 
    wchar_t commitCharacter
)
abstract IsCommitChar : 
        textSoFar:string * 
        selected:int * 
        commitCharacter:char -> bool  
override IsCommitChar : 
        textSoFar:string * 
        selected:int * 
        commitCharacter:char -> bool
public function IsCommitChar(
    textSoFar : String, 
    selected : int, 
    commitCharacter : char
) : boolean

Parameters

  • textSoFar
    Type: String

    [in] A string containing the text typed by the user.

  • selected
    Type: Int32

    [in] The number of characters that are currently selected or -1 if nothing is selected.

  • commitCharacter
    Type: Char

    [in] The character to determine is a completion character.

Return Value

Type: Boolean
If the character is a commit character, returns true; otherwise, returns false.

Remarks

Typing a commit character causes the currently selected item in the completion list to be committed to the source file (through a call to the OnCommit method). This method determines if the character typed can be used to commit the text to the source file.

Text might be selected (for example, because of a previous auto-completion step) and that could change what is considered a commit character.

The base method returns true if the commit character is not a letter, numerical digit, or an underscore.

.NET Framework Security

See Also

Reference

Declarations Class

Microsoft.VisualStudio.Package Namespace