private HResult ExpandItem(IVsUIHierarchy uiHierarchy, HierarchyId id, EXPANDFLAGS flags)
        {
            Requires.NotNull(uiHierarchy, nameof(uiHierarchy));
            Requires.Argument(!(id.IsNilOrEmpty || id.IsSelection), nameof(id), "id must not be nil, empty or represent a selection.");

            return(Invoke(window => window.ExpandItem(uiHierarchy, id, flags)));
        }
Example #2
0
        /// <summary>
        /// Expands the current node.
        /// </summary>
        public void Expand()
        {
            // Get the Solution Explorer window.
            IVsUIHierarchyWindow solutionExplorer = Package.Instance.Context.SolutionExplorer;

            // Expand or collapse the node in the Solution Explorer.
            EXPANDFLAGS flags = EXPANDFLAGS.EXPF_ExpandFolder;

            NativeMethods.ThrowOnFailure(solutionExplorer.ExpandItem(this.Hierarchy, this.HierarchyId, flags));
        }
Example #3
0
        /// <summary>
        /// Makes sure the node is visible in the Solution Explorer by expanding all of it's parents.
        /// </summary>
        public void EnsureVisible()
        {
            // Get the Solution Explorer window.
            IVsUIHierarchyWindow solutionExplorer = Package.Instance.Context.SolutionExplorer;

            // Make sure the node is visible by expanding all of its parents.
            EXPANDFLAGS flags = EXPANDFLAGS.EXPF_ExpandParentsToShowItem;

            NativeMethods.ThrowOnFailure(solutionExplorer.ExpandItem(this.Hierarchy, this.HierarchyId, flags));
        }
Example #4
0
        /// <summary>
        /// Performs the EXPANDFLAGS action on a node with nodeID.
        /// </summary>
        internal static void ManipulateNode(ProjectNode project, uint nodeID, EXPANDFLAGS flag)
        {
            IVsUIHierarchyWindow uiHierarchy = VsShellUtilities.GetUIHierarchyWindow(project.Site, HierarchyNode.SolutionExplorer);

            if (uiHierarchy == null)
            {
                return;
            }

            uiHierarchy.ExpandItem(project, nodeID, flag);
        }
 // --------------------------------------------------------------------------------------------
 /// <summary>
 /// Expands the specified hierarchy item.
 /// </summary>
 /// <param name="window">The hierarchy window hosting the item.</param>
 /// <param name="node">The hierarchy of the node to expand.</param>
 /// <param name="id">The id of the node.</param>
 /// <param name="flags">Flags specifying how to expand the node.</param>
 // --------------------------------------------------------------------------------------------
 private static void ExpandItem(IVsUIHierarchyWindow window, IVsUIHierarchy node, uint id,
                                EXPANDFLAGS flags)
 {
     if (window == null)
     {
         return;
     }
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     ErrorHandler.ThrowOnFailure(window.ExpandItem(node, id, flags));
 }
Example #6
0
        private void Expand(IEnumerable <SolutionItem> items, EXPANDFLAGS flag)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            foreach (SolutionItem item in items)
            {
                item.GetItemInfo(out IVsHierarchy hierarchy, out uint itemID, out IVsHierarchyItem _);
                if (hierarchy is IVsUIHierarchy uiHierarchy)
                {
                    UIHierarchyWindow.ExpandItem(uiHierarchy, itemID, flag);
                }
            }
        }
Example #7
0
 public int ExpandItem(IVsUIHierarchy pUIH, uint itemid, EXPANDFLAGS expf)
 {
     throw new NotImplementedException();
 }
 // --------------------------------------------------------------------------------------------
 /// <summary>
 /// Expands the specified hierarchy item.
 /// </summary>
 /// <param name="window">The hierarchy window hosting the item.</param>
 /// <param name="node">The hierarchy of the node to expand.</param>
 /// <param name="id">The id of the node.</param>
 /// <param name="flags">Flags specifying how to expand the node.</param>
 // --------------------------------------------------------------------------------------------
 private static void ExpandItem(IVsUIHierarchyWindow window, IVsUIHierarchy node, uint id, 
     EXPANDFLAGS flags)
 {
     if (window == null) return;
       if (node == null) throw new ArgumentNullException("node");
       ErrorHandler.ThrowOnFailure(window.ExpandItem(node, id, flags));
 }
Example #9
0
 public int ExpandItem(IVsUIHierarchy pUIH, uint itemid, EXPANDFLAGS expf) {
     throw new NotImplementedException();
 }