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
textView
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextViewAn IVsTextView object representing the view containing the source where the command was entered.
command
Type: Microsoft.VisualStudio.VSConstants.VSStd2KCmdIDA value from the VSConstants.VSStd2KCmdID enumeration specifying the command that was entered.
ch
Type: CharThe 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 |
---|---|---|
parameter separator |
.NET Framework Security
- 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.