This documentation is archived and is not being maintained.

IVsHierarchyEvents.OnItemAdded Method

Notifies clients when an item is added to the hierarchy.

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

abstract OnItemAdded : 
        itemidParent:uint32 * 
        itemidSiblingPrev:uint32 * 
        itemidAdded:uint32 -> int

Parameters

itemidParent
Type: UInt32

[in] Identifier of the parent, or root node of the hierarchy in which the item is added.

itemidSiblingPrev
Type: UInt32

[in] Identifier that indicates where the item is added in relation to other items (siblings) within the parent hierarchy (itemidParent). If the new item is added at the beginning of the sibling items, then a value of VSITEMID_NIL is specified. If the item is added after a particular node, the Item Id of the node in question is specified.

itemidAdded
Type: UInt32

[in] Identifier of the added item.

Return Value

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

COM Signature

From vsshell.idl:

HRESULT IVsHierarchyEvents::OnItemAdded(
   [in] VSITEMID itemidParent,
   [in] VSITEMID itemidSiblingPrev,
   [in] VSITEMID itemidAdded
);

The itemidSiblingPrev parameter controls the order in which the added item appears. For example, if you are adding item C, you would need to pass in the itemidSiblingPrev for an existing item B, for C to appear after B.

Show: