共用方式為


IVsObjectList.GoToSource(UInt32, VSOBJGOTOSRCTYPE) Method

Definition

Navigates to the source for the given list item.

public:
 int GoToSource(System::UInt32 index, Microsoft::VisualStudio::Shell::Interop::VSOBJGOTOSRCTYPE SrcType);
public:
 int GoToSource(unsigned int index, Microsoft::VisualStudio::Shell::Interop::VSOBJGOTOSRCTYPE SrcType);
int GoToSource(unsigned int index, Microsoft::VisualStudio::Shell::Interop::VSOBJGOTOSRCTYPE SrcType);
public int GoToSource (uint index, Microsoft.VisualStudio.Shell.Interop.VSOBJGOTOSRCTYPE SrcType);
abstract member GoToSource : uint32 * Microsoft.VisualStudio.Shell.Interop.VSOBJGOTOSRCTYPE -> int
Public Function GoToSource (index As UInteger, SrcType As VSOBJGOTOSRCTYPE) As Integer

Parameters

index
UInt32

[in] Specifies the index of the list item of interest.

SrcType
VSOBJGOTOSRCTYPE

[in] Specifies the source type. Values are taken from the VSOBJGOTOSRCTYPE enumeration.

Returns

This returns S_OK on success or an hr error (along with rich error information if possible) if the navigation failed.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsObjectList::GoToSource(  
   [in] ULONG Index,  
   [in] VSOBJGOTOSRCTYPE SrcType  
);  

The environment calls GoToSource when the user invokes GoToDefinition, GoToDeclaration, or GoToReference commands provided CanGoToSource returned true. You must navigate to the source for the item, coordinating with your project system, the running document table, and the text editor to actually open the containing source file and navigate to the appropriate line. Also open the appropriate editor's navigation context so that editor's back/forward navigation functions correctly.

Applies to