Source.OnCommand Method
Handles IntelliSense-oriented commands.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.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)
Syntax
'宣言
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
)
Parameters
- textView
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextView
An IVsTextView object representing the view containing the source where the command was entered.
- command
Type: Microsoft.VisualStudio.VSConstants.VSStd2KCmdID
A value from the VSConstants.VSStd2KCmdID enumeration specifying the command that was entered.
- ch
Type: System.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 |
---|---|---|
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.