Compartilhar via


IVsObjectList.GetNavigationInfo(UInt32, VSOBNAVIGATIONINFO2[]) Method

Definition

Fills the VSOBNAVIGATIONINFO2 structure for the given list item allowing the list to navigate back to it through LocateNavigationInfo(VSOBNAVIGATIONINFO2[], VSOBNAVNAMEINFONODE[], Int32, Int32, UInt32[]).

public:
 int GetNavigationInfo(System::UInt32 index, cli::array <Microsoft::VisualStudio::Shell::Interop::VSOBNAVIGATIONINFO2> ^ pobNav);
int GetNavigationInfo(unsigned int index, std::Array <Microsoft::VisualStudio::Shell::Interop::VSOBNAVIGATIONINFO2> const & pobNav);
public int GetNavigationInfo (uint index, Microsoft.VisualStudio.Shell.Interop.VSOBNAVIGATIONINFO2[] pobNav);
abstract member GetNavigationInfo : uint32 * Microsoft.VisualStudio.Shell.Interop.VSOBNAVIGATIONINFO2[] -> int
Public Function GetNavigationInfo (index As UInteger, pobNav As VSOBNAVIGATIONINFO2()) As Integer

Parameters

index
UInt32

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

pobNav
VSOBNAVIGATIONINFO2[]

[in, out] Specifies navigation information. Values are placed in a VSOBNAVIGATIONINFO2 structure.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsObjectList::GetNavigationInfo(  
   [in] ULONG Index,  
   [in, out] VSOBNAVIGATIONINFO2 *pobNav  
);  

When an object has been selected in Object Browser or Class View, and the environment must redraw the view as a result of a sort or expansion, a path back to the selected item must be maintained. The environment will call GetNavigationInfo for the selected object, and each of its parents, ascending the tree until the root node is reached. The environment can then descend the tree, with calls to LocateNavigationInfo to locate the originally selected object. The environment creates the pobNav structure and passes it to you. You fill pobNav with appropriate values for the index node, and return the structure to the environment. The structure is shown below for reference.

typedef struct _VSOBNAVIGATIONINFO2

{

GUID* pguididLib;

WCHAR* pszLibName;

VSOBNAVNAMEINFONODE* pName;

DWORD dwCustom;

}

Place the GUID of your library into pguididLib and the library name into pszLibName. These two parameters not usually change throughout the series of GetNavigationInfo calls. You may store any custom information in dwCustom. VSOBNAVNAMEINFONODE is a linked list structure that holds the name and type of each node in the navigation tree. Set these values appropriately for each GetNavigationInfo call. The environment handles the linked list addressing.

For more details on these structures see VSOBNAVIGATIONINFO2 and VSOBNAVNAMEINFONODE.

Applies to