Compartir a través de


Source.OnCommand Method

Handles IntelliSense-oriented commands.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.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 Sub OnCommand ( _
    textView As IVsTextView, _
    command As VSConstants.VSStd2KCmdID, _
    ch As Char _
)
public virtual void OnCommand(
    IVsTextView textView,
    VSConstants.VSStd2KCmdID command,
    char ch
)
public:
virtual void OnCommand(
    IVsTextView^ textView, 
    VSConstants::VSStd2KCmdID command, 
    wchar_t ch
)
abstract OnCommand : 
        textView:IVsTextView * 
        command:VSConstants.VSStd2KCmdID * 
        ch:char -> unit  
override OnCommand : 
        textView:IVsTextView * 
        command:VSConstants.VSStd2KCmdID * 
        ch:char -> unit
public function OnCommand(
    textView : IVsTextView, 
    command : VSConstants.VSStd2KCmdID, 
    ch : char
)

Parameters

  • ch
    Type: Char

    The character that was typed.

Remarks

This method is called when a command is entered. All this method does is support IntelliSense operations.

By the time this method is called, any character the user has just typed has been added to the source file just before the current caret position.

The base method does nothing if the EnableCodeSense property is false. Otherwise, this method gets the current caret position and then the token at the current caret position. Based on the token triggers and what the command is, the appropriate method that supports the desired IntelliSense operation is called.

Trigger

Command

Method Called

MemberSelect

TYPECHAR

Completion

MatchBraces

TYPECHAR

MatchBraces

MethodTip

TYPECHAR

MethodTip

ParameterNext

parameter separator

AdjustCurrentParameter

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace