共用方式為


IVsUIHierarchyWindow.FindCommonSelectedHierarchy Method

Finds the lowermost hierarchy that is the nearest ancestor to every selected node.

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

Syntax

'Declaration
Function FindCommonSelectedHierarchy ( _
    grfOpt As UInteger, _
    <OutAttribute> ByRef lppCommonUIH As IVsUIHierarchy _
) As Integer
int FindCommonSelectedHierarchy(
    uint grfOpt,
    out IVsUIHierarchy lppCommonUIH
)
int FindCommonSelectedHierarchy(
    [InAttribute] unsigned int grfOpt, 
    [OutAttribute] IVsUIHierarchy^% lppCommonUIH
)
abstract FindCommonSelectedHierarchy : 
        grfOpt:uint32 * 
        lppCommonUIH:IVsUIHierarchy byref -> int
function FindCommonSelectedHierarchy(
    grfOpt : uint, 
    lppCommonUIH : IVsUIHierarchy
) : int

Parameters

  • grfOpt
    Type: UInt32

    [in] Controls whether this method returns the Solution as the common hierarchy. For a list of grfOpt values, see __VSCOMHIEROPTIONS.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIHierarchyWindow::FindCommonSelectedHierarchy(
   [in] VSCOMHIEROPTIONS grfOpt,
   [out, retval] IVsUIHierarchy** lppCommonUIH
);

The UI hierarchy window contains a parent chain of hierarchies. If you select two or more nodes that reside in the same hierarchy, this method returns the parent of that hierarchy. Similarly, if you select nodes that reside in two different hierarchies, this method returns the parent of those two hierarchies.

.NET Framework Security

See Also

Reference

IVsUIHierarchyWindow Interface

Microsoft.VisualStudio.Shell.Interop Namespace