示例#1
0
        private void ExpandNode(NodeViewModel node)
        {
            CheckOnUIThread();
            var uiHierarchyWindow = VsHierarchyUtilities.GetSolutionExplorer(_serviceProvider);

            if (uiHierarchyWindow == null)
            {
                return;
            }

            uint pdwState;

            if (ErrorHandler.Failed(uiHierarchyWindow.GetItemState(this, node.ItemId, (int)__VSHIERARCHYITEMSTATE.HIS_Expanded, out pdwState)))
            {
                return;
            }

            if (pdwState == (uint)__VSHIERARCHYITEMSTATE.HIS_Expanded)
            {
                return;
            }

            if (ErrorHandler.Failed(uiHierarchyWindow.ExpandItem(this, node.ItemId, EXPANDFLAGS.EXPF_ExpandParentsToShowItem)) ||
                ErrorHandler.Failed(uiHierarchyWindow.ExpandItem(this, node.ItemId, EXPANDFLAGS.EXPF_ExpandFolder)))
            {
                return;
            }
        }
示例#2
0
        public void SelectNode(NodeViewModel node)
        {
            CheckOnUIThread();
            var uiHierarchyWindow = VsHierarchyUtilities.GetSolutionExplorer(_serviceProvider);

            if (uiHierarchyWindow == null)
            {
                return;
            }

            if (ErrorHandler.Failed(uiHierarchyWindow.ExpandItem(this, node.ItemId, EXPANDFLAGS.EXPF_SelectItem)))
            {
                Logger.LogError("Error selecting item in solution explorer.");
            }
        }