internal static VSITEMEX GetParentItemEx(this VSITEMEX vsItemEx, bool bForce = false) { if (!bForce && vsItemEx.vsParentItem != null) { return(vsItemEx.vsParentItem); } VSITEMEX vsParentItem = null; uint parentId = vsItemEx.GetParentID(); if (parentId == VSConstants.VSITEMID_NIL) { vsItemEx.vsParentItem = null; return(null); } uint parentHierId = vsItemEx.GetParentHierarchyID(); IVsHierarchy vsParent = vsItemEx.GetParentHierarchy(); if (vsParent == null) { return(null); } vsParentItem = new VSITEMEX(vsParent, parentId); vsParentItem.GetCanonicalName(); vsItemEx.vsParentItem = vsParentItem; return(vsParentItem); }
//since 2.1.2 internal static bool IsRootSolution(this VSITEMEX vsItemEx) { vsItemEx.GetItemType(); vsItemEx.GetParentID(); if (vsItemEx.pHier is IVsSolution) { return(true); } // vsItemEx.GetParentHierarchy(); if (vsItemEx.typeGuid == Guid.Empty && (vsItemEx.parentId == VSConstants.VSITEMID_NIL || vsItemEx.parentId == 0)) { return(true); } return(false); }