Ejemplo n.º 1
0
        public IVsHierarchyItem GetActiveHierarchy()
        {
            return(asyncManager.Run(async() => {
                await asyncManager.SwitchToMainThread();
                IVsUIHierarchy uiHier;
                if (ErrorHandler.Failed(hierarchyWindow.FindCommonSelectedHierarchy((uint)__VSCOMHIEROPTIONS.COMHIEROPT_RootHierarchyOnly, out uiHier)))
                {
                    return null;
                }

                return hierarchyManager.GetHierarchyItem(uiHier, VSConstants.VSITEMID_ROOT);
            }));
        }
Ejemplo n.º 2
0
 // --------------------------------------------------------------------------------------------
 /// <summary>
 /// Finds the common selection.
 /// </summary>
 /// <param name="window">The window.</param>
 /// <param name="commonHier">The common hier.</param>
 // --------------------------------------------------------------------------------------------
 public static int FindCommonSelectionRoot(this IVsUIHierarchyWindow window,
                                           out IVsUIHierarchy commonHier)
 {
     return(window.FindCommonSelectedHierarchy(
                (uint)__VSCOMHIEROPTIONS.COMHIEROPT_AllowHiddenRoot, out commonHier));
 }