Dela via


IVsObjectList2.GoToSource Method

Navigates to the source for the given list item.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'Declaration
Function GoToSource ( _
    index As UInteger, _
    SrcType As VSOBJGOTOSRCTYPE _
) As Integer
int GoToSource(
    uint index,
    VSOBJGOTOSRCTYPE SrcType
)
int GoToSource(
    [InAttribute] unsigned int index, 
    [InAttribute] VSOBJGOTOSRCTYPE SrcType
)
abstract GoToSource : 
        index:uint32 * 
        SrcType:VSOBJGOTOSRCTYPE -> int
function GoToSource(
    index : uint, 
    SrcType : VSOBJGOTOSRCTYPE
) : int

Parameters

  • index
    Type: UInt32

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

Return Value

Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell80.idl:

[C++]

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

This method handles the GoToDeclaration and 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 the editor's back/forward navigation functions correctly.

.NET Framework Security

See Also

Reference

IVsObjectList2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace