ViewFilter.HandleGoto Method
Processes the specified "go to" command.
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.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'Declaración
Public Overridable Sub HandleGoto ( _
cmd As VSConstants..::..VSStd97CmdID _
)
'Uso
Dim instance As ViewFilter
Dim cmd As VSConstants..::..VSStd97CmdID
instance.HandleGoto(cmd)
public virtual void HandleGoto(
VSConstants..::..VSStd97CmdID cmd
)
public:
virtual void HandleGoto(
VSConstants..::..VSStd97CmdID cmd
)
abstract HandleGoto :
cmd:VSConstants..::..VSStd97CmdID -> unit
override HandleGoto :
cmd:VSConstants..::..VSStd97CmdID -> unit
public function HandleGoto(
cmd : VSConstants..::..VSStd97CmdID
)
Parameters
- cmd
Type: Microsoft.VisualStudio.VSConstants.VSStd97CmdID
[in] A value from the VSConstants.VSStd97CmdID enumeration specifying the type of "go to" command to execute. Expected values are GotoDefn, GotoDecl, and GotoRef.
Remarks
This method is called to handle a "go to" command. This method is responsible for obtaining the appropriate uniform resource identifier (URI) from the parser and then loading the requested document.
The base method calls the GetCaretPos method on the IVsTextView object passed to the ViewFilter constructor to obtain the current caret position. This position is then passed to the OnSyncGoto(VSConstants.VSStd97CmdID, IVsTextView, Int32, Int32, TextSpan%) method on the Source object (obtained from the CodeWindowManager object in the ViewFilter constructor). If OnSyncGoto(VSConstants.VSStd97CmdID, IVsTextView, Int32, Int32, TextSpan%) returned a valid URI then the URI is passed to the OpenDocument(IServiceProvider, String) helper method in the VsShell class to open the document. If the document is successfully opened, the EnsureSpanVisible method is called followed by the SetSelection method to show the destination span in the loaded file.
In the default managed package framework implementation of the language service classes, this method is called from the HandlePreExec method.
.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.